Skip to content

Fix OAuth exchange attempted for repos configured before v2.4.0#1120

Merged
ericmj merged 1 commit intomainfrom
fix-oauth-exchange-default-for-existing-repos
Mar 16, 2026
Merged

Fix OAuth exchange attempted for repos configured before v2.4.0#1120
ericmj merged 1 commit intomainfrom
fix-oauth-exchange-default-for-existing-repos

Conversation

@ericmj
Copy link
Copy Markdown
Member

@ericmj ericmj commented Mar 16, 2026

Repos configured before v2.4.0 don't have the oauth_exchange key in their saved config. The default in build_hex_core_config was true, causing hex to attempt OAuth token exchange for repos that don't support it (for example oban), resulting in :exchange_failed errors.

Change the default to false. This is safe because hexpm repos always have oauth_exchange: true explicitly set, and repos added with v2.4.0 have it explicitly set by the add command.

Also fix a test isolation issue where oauth_token from the user's actual ~/.hex/hex.config leaked into test state via init_reset_state.

Closes #1119.

Repos configured before v2.4.0 don't have the oauth_exchange key in
their saved config. The default in build_hex_core_config was true,
causing hex to attempt OAuth token exchange for repos that don't
support it (e.g. getoban.pro), resulting in :exchange_failed errors.

Change the default to false. This is safe because hexpm repos always
have oauth_exchange: true explicitly set, and repos added with v2.4.0
have it explicitly set by the add command.

Also fix a test isolation issue where oauth_token from the user's
actual ~/.hex/hex.config leaked into test state via init_reset_state.

Closes #1119
@ericmj ericmj merged commit 84f2d67 into main Mar 16, 2026
20 checks passed
@ericmj ericmj deleted the fix-oauth-exchange-default-for-existing-repos branch March 16, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue fetching deps with authentication on hex version 2.4.0

1 participant