Skip to content

Expose verified account identity in sessions - #362

Merged
jserv merged 1 commit into
sysprog21:mainfrom
yang94080-cloud:verify-account-identity
Oct 23, 2026
Merged

jserv merged 1 commit into
sysprog21:mainfrom
yang94080-cloud:verify-account-identity

Conversation

@yang94080-cloud

@yang94080-cloud yang94080-cloud commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Signed-in session responses do not distinguish GitHub OAuth accounts from self-declared handles. This adds identityVerified to /api/session, derived from the stored users.github_id > 0, and documents the caller invariant that makes this distinction valid. Token admission and recording eligibility remain unchanged.

Two regression tests cover self-declared sign-in and OAuth sign-in without email. Both failed on the missing field before the implementation and passed afterward. The OAuth test uses a stub whose email endpoint would return 403; recording is disabled, so that endpoint is not requested.

Validation: the two targeted tests passed, and ./scripts/test.sh exited with code 0. The gate reported skipped browser checks due to unavailable Chromium, Java, or browser/server prerequisites, and skipped cargo-audit, actionlint, ruff, and shellcheck.

This implements P1 of #306.

Refs #306

Closes #315


Summary by cubic

Signed-in session responses now include identityVerified, letting clients distinguish GitHub OAuth accounts from self-declared handles. The flag is derived from users.github_id > 0, relying on the existing caller invariant that only the OAuth callback stores positive IDs. Token admission and recording eligibility are unchanged.

Regression tests cover self-declared sign-in, OAuth sign-in without email, the zero GitHub ID boundary that guards against an accidental > to >= change, and identity isolation when a typed handle matches an existing OAuth account's login. This implements P1 of #306 and closes #315.

Written for commit 23b5704. Summary will update on new commits.

View guided diff

cubic-dev-ai[bot]

This comment was marked as resolved.

@yang94080-cloud

Copy link
Copy Markdown
Contributor Author

The formatting and mutation checks now pass. The remaining failure is the report is a modal dialog with one primary action, which times out clicking #force-report.

The same failure also occurs on upstream main at 152d3e6, without this PR:

This appears to be a timing race: without an interviewer, endInterview() schedules showReport() after 300 ms, which hides the ending overlay while the test is trying to click its offline-summary button. I have left the browser code unchanged to keep this PR scoped to #315.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rebase latest main branch which lands CI fixes.

@yang94080-cloud
yang94080-cloud force-pushed the verify-account-identity branch from 3037a0d to 95cd325 Compare October 20, 2026 07:39
@jserv
jserv requested review from ColtenOuO and alanhc October 21, 2026 03:38
Comment thread tests/web/accounts.rs Outdated
Comment thread tests/web/accounts.rs

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The last two commits are follow-ups to review on the first one. Could you squash them into a single commit before merge?

Comment thread tests/web/accounts.rs Outdated
Comment thread tests/web/accounts.rs
Comment thread src/accounts/sessions.rs Outdated
@yang94080-cloud
yang94080-cloud force-pushed the verify-account-identity branch from e122aa3 to 5786643 Compare October 22, 2026 09:04
@yang94080-cloud

Copy link
Copy Markdown
Contributor Author

Squashed into a single commit, 5786643.

@yang94080-cloud

Copy link
Copy Markdown
Contributor Author

The browser lane failed in problem cards span desktop panels and return home on narrow screens at tests/browser/lobby.test.js:6457, with 57 !== 4. This test uses a stub server rather than the Rust session handler. The Rust, portable, and mutation checks passed. Could a maintainer rerun the failed jobs once to check reproducibility?

https://github.com/sysprog21/codetrial/actions/runs/39752627547/job/119738106918

@jserv

jserv commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Could a maintainer rerun the failed jobs once to check reproducibility?

No, it needs extra fixes. Wait for my PR.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rebase latest main branch to pick up the CI fixes from #434.

Peer interviews need to distinguish OAuth accounts from self-declared
handles without treating email availability as proof of identity.
Expose the distinction under the existing account ID invariant and
guard against same-name account confusion and the zero ID boundary.
Token admission and recording eligibility remain unchanged.
@yang94080-cloud
yang94080-cloud force-pushed the verify-account-identity branch from 5786643 to 23b5704 Compare October 22, 2026 18:48

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Let's wait for CI :)

@jserv
jserv merged commit 2bd641e into sysprog21:main Oct 23, 2026
10 checks passed
@jserv

jserv commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Thank @yang94080-cloud for contributing!

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.

Distinguish GitHub OAuth accounts from self-declared accounts

3 participants