Fix hardcoded US region default; add EU region integration tests (#152) - #155
Merged
Merged
Conversation
TConnectApi and TandemSourceApi defaulted their region parameter to a hardcoded 'US', so callers that construct them without an explicit region (e.g. tconnectsync-heroku's check_login path) sent EU accounts to the US login endpoint, which rejected them with HTTP 401 account/invalid_credentials even when TCONNECT_REGION=EU was set. Both classes (and fetch_oneshot) now fall back to the configured TCONNECT_REGION when no region argument is given, so downstream consumers honor the .env/environment configuration. Adds top-level integration tests that configure the EU region via each supported mechanism (TCONNECT_REGION environment variable, .env file, and --region CLI flag) and drive the real downstream code -- including the full main(['--check-login']) entrypoint -- against a mocked HTTP layer with a real RS256-signed OIDC id_token. Only the EU endpoints are registered, and the tests assert the EU login/token/jwks/pumper/ pump-logs endpoints are actually invoked and that no US host is ever contacted. Fixes #152 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DEvvZSWHo2dki5h1HikUU
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DEvvZSWHo2dki5h1HikUU
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.
TConnectApi and TandemSourceApi defaulted their region parameter to a
hardcoded 'US', so callers that construct them without an explicit
region (e.g. tconnectsync-heroku's check_login path) sent EU accounts
to the US login endpoint, which rejected them with HTTP 401
account/invalid_credentials even when TCONNECT_REGION=EU was set.
Both classes (and fetch_oneshot) now fall back to the configured
TCONNECT_REGION when no region argument is given, so downstream
consumers honor the .env/environment configuration.
Adds top-level integration tests that configure the EU region via each
supported mechanism (TCONNECT_REGION environment variable, .env file,
and --region CLI flag) and drive the real downstream code -- including
the full main(['--check-login']) entrypoint -- against a mocked HTTP
layer with a real RS256-signed OIDC id_token. Only the EU endpoints are
registered, and the tests assert the EU login/token/jwks/pumper/
pump-logs endpoints are actually invoked and that no US host is ever
contacted.
Fixes #152
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_012DEvvZSWHo2dki5h1HikUU