fix: restore environment variable fallback for API key#43
Open
Rayhan1967 wants to merge 1 commit intolaunchdarkly:mainfrom
Open
fix: restore environment variable fallback for API key#43Rayhan1967 wants to merge 1 commit intolaunchdarkly:mainfrom
Rayhan1967 wants to merge 1 commit intolaunchdarkly:mainfrom
Conversation
Contributor
|
Hey @Rayhan1967 , this is a change to a generated file, so it won't stick. but i've raised this with the SDK team for the codegen to see if they can get this fix in! |
Contributor
|
@Rayhan1967 Actually, just heard back from the team, we'll have this fixed up soon! |
|
can this be merged in as a provisional fix until the permanent codegen fix is in place? it's been open 10 days and without the fix any mcp configs that rely on the env var interpolation are busted. |
@nieblara this still gonna be fixed up soonish? just wondering when to check back. |
|
@nieblara can you please merge this or get it escalated to someone who can? thanks! |
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.
Description
This PR resolves an issue where the
LAUNCHDARKLY_API_KEYenvironment variable fallback was ignored when the--api-keyCLI flag was not provided.Problem
The root cause was that the CLI implementation defaulted the
apiKeyto an empty string ("") when the flag was missing. Because the security module uses the nullish coalescing operator (??) to handle fallbacks, the empty string was treated as a defined value, preventing the intended fallback to the environment variable.Solution
The default value for
apiKeyin the CLI start implementation has been changed from""toundefined. This allows the nullish coalescing logic to correctly fall back to theLAUNCHDARKLY_API_KEYenvironment variable when the CLI flag is omitted.Verification
Logic was verified by demonstrating that
undefinedallows the??operator to proceed to the fallback value, whereas""does not.This change improves support for MCP clients and automated environments that rely on environment variables for configuration.
#42