Skip to content

Create keys in integration tests from a two-factor sign-in - #1278

Merged
ericmj merged 2 commits into
mainfrom
no-keys-from-keys
Oct 16, 2026
Merged

ericmj merged 2 commits into
mainfrom
no-keys-from-keys

Conversation

@ericmj

@ericmj ericmj commented Oct 16, 2026

Copy link
Copy Markdown
Member

hexpm refuses an API key, or a token exchanged for one, when creating API keys (hexpm/hexpm#2055). The integration tests that created keys with a key now sign in the way mix hex.user auth does: a user with two-factor authentication and an OAuth token, with the TOTP code that OAuth writes need. HexTest.Hexpm gains new_tfa_user/3, sign_in/1 and the totp/1 helper that Hex.OrganizationAuthIntegrationTest had.

The suite passes against hexpm main and against the branch of hexpm/hexpm#2055 (850 tests, 2 skipped, each).

hexpm refuses an API key, or a token exchanged for one, when creating
API keys (hexpm/hexpm#2055). The tests that created keys with a key now
sign in the way mix hex.user auth does: a user with two-factor
authentication and an OAuth token, with the TOTP code that OAuth writes
need. They pass against hexpm with and without that change.
The test authorized the organization with a stored key, which hexpm#2055
refuses for key creation, and then passed because deauth leaves no repo
either way. It now signs in with two-factor and checks that auth added
the repo before deauth removes it.
@ericmj
ericmj merged commit 7ab3687 into main Oct 16, 2026
15 checks passed
@ericmj
ericmj deleted the no-keys-from-keys branch October 16, 2026 17: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.

1 participant