Skip to content

[scanner] hub-auth: document Hub login token consumers, lifetime and empty-scope behavior #14632

Closed

Description

@hivecommons-hive

Part of #14598

Target branch: v6

Scope

Documentation and audit only, no behavior change. The Hub encrypts and persists the GitHub user token (encryptToken, src/pkg/hub/saas_crypto.go:34; stored at src/pkg/hub/oauth.go:847; exposed to authenticated callers via handleUserToken, src/pkg/hub/saas_auth.go:740, route registered at src/pkg/hub/saas.go:449; also GitHubToken at src/pkg/hub/saas_provision.go:919). Enumerate every consumer of the stored token, state which Hub features need it, and record its expected lifetime/refresh behavior (GitHub OAuth-app tokens do not expire by default). Also verify against GitHub's documented behavior and document that an empty-scope authorize request (src/pkg/hub/oauth.go:603) can still yield scopes the user previously granted to the OAuth app, so we do not claim an empty scope revokes prior grants. Record that the GitHub App installation credential is separate from the human login token, that direct-spoke device flow (src/pkg/dashboard/api_auth.go) and hosted SSO are unchanged, and list the follow-up question of offering browser redirect to direct spokes as undecided. Do NOT change token storage, retention or refresh here.

Decision taken by hive: put it in a new doc under docs/ (e.g. docs/hub-login-token.md) and add a short pointer comment above the exchange in oauth.go.

Acceptance criteria

  • New doc lists each token consumer with path:line, lifetime/refresh behavior, and the empty-scope caveat.
  • No code behavior change; existing tests untouched.

Likely files

  • docs/hub-login-token.md (new)
  • src/pkg/hub/oauth.go (comment only)

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 27, 2026
  2. github-actions commented on Oct 27, 2026

    @github-actions
    Contributor

    Closed by #14683 (merged to v6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/scannerCreated or modified by the scanner agenthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions