Skip to content

feat(extension): harden auth session handling - #195

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
oktofeesh1:codex/extension-secure-auth
Jun 1, 2026
Merged

feat(extension): harden auth session handling#195
JSONbored merged 2 commits into
JSONbored:mainfrom
oktofeesh1:codex/extension-secure-auth

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

What changed

  • Added a shared extension auth helper for local-only token storage, GitHub PAT rejection, legacy sync-token cleanup, expiry handling, revoked-session cleanup, and logout.
  • Required extension:pull_context sessions for /v1/extension/pull-context instead of allowing full browser/static API sessions.
  • Updated extension options, package assembly, OpenAPI docs, and the extension page privacy/permission copy.
  • Added regression tests for local storage invariants, PAT rejection, expiry/revocation cleanup, logout clearing, and API route scope enforcement.

Why

  • Extension auth is a sensitive boundary: Gittensory extension tokens should not be confused with GitHub PATs, full app sessions, or static API tokens, and stale/revoked sessions need to fail closed.

Validation

  • npm run typecheck
  • npm run test:unit -- test/unit/extension-auth.test.ts test/unit/openapi.test.ts
  • npm run test:integration -- test/integration/api.test.ts
  • npm run ui:openapi
  • npm run extension:build
  • npm run test:ci
  • Codex Security diff scan: no reportable findings; all 13 worklist rows completed.

Notes

  • The extension still supports a configurable API origin, but normalizes it to HTTPS or localhost-style development origins before using it.

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@oktofeesh1 This is ready from my side. Extension auth session handling is better isolated, the browser extension no longer needs broad app credentials, and the API/OpenAPI/tests cover the scoped session path. Current checks are green and the merge tree is clean.

@dosubot dosubot Bot added the lgtm label Jun 1, 2026
@JSONbored
JSONbored merged commit 4ffb358 into JSONbored:main Jun 1, 2026
3 checks passed
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed feature labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(extension): add secure auth and session handling

2 participants