Skip to content

Verify organization 2FA and SSO requirements before fetching - #1237

Open
ericmj wants to merge 5 commits into
mainfrom
organization-tfa-enforcement
Open

ericmj wants to merge 5 commits into
mainfrom
organization-tfa-enforcement

Conversation

@ericmj

@ericmj ericmj commented Sep 9, 2026

Copy link
Copy Markdown
Member

When private dependencies need organization authentication, Hex names the affected organizations and displays separate 2FA enrollment and SSO requirements. The shared browser flow completes outstanding requirements before the client refreshes scopes and resumes fetching, and outstanding requirements are kept when the flow is cancelled, expires, or receives EOF.

Vendor the corresponding hex_core protocol changes and add integration coverage against Hexpm for organization scope filtering, verification requests, and an enrolled member keeping access when a policy starts. The integration harness starts the server with organization 2FA policies enabled. The full Hex suite against the changed server passed 662 tests with one existing skip; formatting passed.

Depends on hexpm/hex_core#222, vendored from hexpm/hex_core@68d8345.

Related: hexpm/hexpm#1913, hexpm/hex_core#222.

Draft CI runs against the organization-tfa-enforcement server branch from hexpm/hexpm#1913. Restore HEXPM_BRANCH: main after that server change merges and before merging this PR.

HEXPM_OTP: OTP-28.5
HEXPM_ELIXIR: v1.19.5
HEXPM_BRANCH: main
HEXPM_BRANCH: organization-tfa-enforcement

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs reverting back to main before merging.

@ericmj
ericmj marked this pull request as ready for review September 10, 2026 02:28
The server no longer tracks per-session 2FA verification, so the "tfa"
requirement means the account has to enable two-factor authentication.
Label it that way in the reauthorization prompt, start the integration
server with organization 2FA policies enabled, and cover both an
unenrolled member seeing the requirement and an enrolled member keeping
organization access when a policy starts.
The server decides whether a browser request was completed, so the
client no longer skips the refresh when the verification URL's expiry
has passed by the time the user presses Enter. Re-vendor hex_core from
68d8345 for the improper requirement list fix.
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