feat(cdn): enhance CdnDefinitionProvider with environment variable ha…#2189
Open
sharjeelyunus wants to merge 2 commits intomainfrom
Open
feat(cdn): enhance CdnDefinitionProvider with environment variable ha…#2189sharjeelyunus wants to merge 2 commits intomainfrom
sharjeelyunus wants to merge 2 commits intomainfrom
Conversation
…ndling and secret management - Added support for loading environment variables from asset files, including `.env.secrets` and `.env`. - Implemented methods to manage runtime secrets and ensure compatibility with existing dotenv initialization. - Enhanced the manifest decoding process to extract secrets from the artifacts section. - Introduced utility functions for base64 and hex decoding to support secret parsing.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3074ba4. Configure here.
…DefinitionProvider - Enhanced the _applySecretsFromRoot method to ensure runtime secrets are cleared when no artifacts are present. - Updated secret retrieval logic to prioritize asset environment variables and handle dotenv initialization more robustly. - Removed redundant calls to _applySecretsFromRoot in manifest processing to streamline the workflow. - Introduced a flag to track successful fetching of encrypted manifests, improving error handling during HTTP requests.
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.

…ndling and secret management
.env.secretsand.env.Note
Medium Risk
Adds conditional fetching/decryption of an encrypted CDN manifest and new secret/env merging logic, which could break app startup or secret resolution if keys/payloads are misconfigured. Touches network loading and runtime configuration paths but is scoped to
CdnDefinitionProvider.Overview
CdnDefinitionProvidernow preloads env values from bundled.env.secrets/.envassets (and merges existingdotenv) so it can reliably detect and use encryption settings during initialization.Manifest fetching is enhanced to optionally request
encrypted-manifest.json(with optionalx-manifest-key), decrypt an AES-GCM envelope, and fall back tomanifest.jsonon 404; decoding also now handles wrapped manifests via_decodeManifestRoot.Secrets handling is expanded by extracting
artifacts.secretsfrom the manifest into runtime secrets and returning them alongsidedotenvsecrets viagetSecrets().Reviewed by Cursor Bugbot for commit 3074ba4. Configure here.