fix: route CogIdP auth to dev instance for dev clusters (AUTH-4275) - #3172
fix: route CogIdP auth to dev instance for dev clusters (AUTH-4275)#3172EliasBjorne wants to merge 1 commit into
Conversation
When PROVIDER=cdf and the CDF_CLUSTER name contains '-dev' (e.g. az-arn-dev-002, aws-dub-dev, gc-bru-dev-003), point the OAuth token URL and admin API base at CogIdP dev (https://auth-dev.cognitedata-development.cognite.ai) instead of the production instance (https://auth.cognite.com). This unblocks teams using cog-dev-* orgs after the Auth team migrated dev clusters to CogIdP dev as their primary source of truth (AUTH-4275). Co-authored-by: Cursor <cursoragent@cursor.com>
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
Summary
PROVIDER=cdf, the OAuth token URL and CogIdP admin API base were hardcoded to the production CogIdP instance (https://auth.cognite.com), even for dev clusters.cog-dev-*orgs on dev clusters (az-arn-dev-002,aws-dub-dev,gc-bru-dev-003) now require the CogIdP dev instance (https://auth-dev.cognitedata-development.cognite.ai).CDF_CLUSTERname contains-devand routes accordingly — no env-var changes needed from the user.Changed files
cognite_toolkit/_cdf_tk/utils/auth.py—idp_token_urlnow returns the CogIdP dev token URL for dev clusterscognite_toolkit/_cdf_tk/client/config.py—create_auth_url()now builds URLs against the CogIdP dev API base for dev clustersTest plan
EnvironmentVariables(CDF_CLUSTER="az-arn-dev-002", ..., PROVIDER="cdf").idp_token_urlreturnshttps://auth-dev.cognitedata-development.cognite.ai/oauth2/tokenEnvironmentVariables(CDF_CLUSTER="westeurope-1", ..., PROVIDER="cdf").idp_token_urlreturnshttps://auth.cognite.com/oauth2/token(no regression)config.create_auth_url("/principals/me")returns the correct base URL based on clustercdf auth verifyagainst acog-dev-aiproject onaz-arn-dev-002Context
Jeremy St. Ange flagged in Slack that the CLI breaks for users of the
cog-dev-aiorg after the Auth team switched dev clusters to CogIdP dev as primary source of truth. Related Jira: AUTH-4275.Made with Cursor