feat: Integrate dynamic API key injection#1551
Open
willum070 wants to merge 14 commits into
Open
Conversation
5af9ba7 to
0a1b736
Compare
… clean up legacy env variables
4b534d5 to
41e0831
Compare
f89c5c0 to
0ccb1f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔑 feat: Enable Dynamic API Key Injection & Restore Playwright Tests
This PR accomplishes the following:
"GOOGLE_MAPS_API_KEY") in all sample files where API keys are defined.vite.config.jswith a new pre-enforcedcode-transformplugin. During local builds, this works alongside the existinghtml-transformplugin to scan JS/TS/HTML code for the"GOOGLE_MAPS_API_KEY"placeholder and dynamically injects the API key loaded from the local.envfile or CI environment.JS_MAPS_DEV_KEY): Pipes the repository's dedicated development key (${{ secrets.JS_MAPS_DEV_KEY }}) into the CI runner during automated tests (tests.yml). This ensures thevite.config.jsplugins correctly inject the dev key during test builds.JS_MAPS_PROD_KEY): Pipes the repository's production API key (${{ secrets.JS_MAPS_PROD_KEY }}) into the global environment block of therelease.ymlworkflow. This ensures the Vite plugins inject the production key into the finaldist/HTML and JS artifacts when building public samples for the documentation.e2e/samples.spec.ts). Resolves a critical bug wherevite previewwas spawning background zombie processes and causing GitHub Actions to hang indefinitely by rewriting the test runner to execute the underlyingvite/bin/vite.jsNode script directly.These changes provide the following benefits:
JS_MAPS_DEV_KEY, and public releases useJS_MAPS_PROD_KEY. Since our production API key no longer has local port restrictions, this isolation greatly enhances security and prepares us to make life much more difficult for scrapers.