Open
Conversation
- Replace client_id with env-specific scope_id in token URL - Add AUTH_SCOPE_IDS map to constants for all environments - Validate COGSOL_ENV before attempting token acquisition - Fix import order (ruff) and update tests to set COGSOL_ENV Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r invalid COGSOL_ENV
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
Fixes the token URL construction in
_refresh_bearer_tokenso that the OAuth scope uses the correct, environment-specific application ID instead of the client's own ID.Type of Change
Related Issues
Fixes #(issue number)
Changes Made
cogsol/core/constants.pyAdded
AUTH_SCOPE_IDS, a mapping from eachCOGSOL_ENVvalue (development,testing,implantation,production) to its corresponding Azure AD B2C application (scope) ID.cogsol/core/api.pyAUTH_SCOPE_IDSusing the currentCOGSOL_ENVbefore building the MSAL token request.tests/test_api_key_errors.pyUpdated
TestMissingAuthSecrettests to setCOGSOL_ENV=developmentso the new env validation passes and the existingCOGSOL_AUTH_SECRETerror path is still exercised.Testing Done
Checklist