Skip to content

feat(auth): add scoped personal access tokens - #1686

Open
hgaol wants to merge 2 commits into
apache:devfrom
hgaol:feat/pat-user-access
Open

hgaol wants to merge 2 commits into
apache:devfrom
hgaol:feat/pat-user-access

Conversation

@hgaol

@hgaol hgaol commented Nov 23, 2026

Copy link
Copy Markdown
Member

Fixes #1555

Proposed Changes

  • Add scoped, expiring personal access tokens for existing user accounts, including revocation and account settings management.
  • Add Bearer token authentication with route scopes for core actions and an admin-controlled security toggle.
  • Update API documentation and add backend and UI test coverage.

Add user-owned expiring and revocable credentials, strict Bearer authentication, semantic route scopes, current account resolution, recent-authentication checks, account lifecycle hooks, and default-off admin controls. Include account-settings management, HTTP documentation, and end-to-end coverage for two eligible users creating content and voting through PATs.
@LinkinStars

Copy link
Copy Markdown
Member

The PAT lookup selects an external login by user_id without filtering by provider, then passes its ExternalID to the active UserCenter plugin.

For example, a local account linked only to GitHub is correctly exempt from UserCenter status checks during password login, but its PAT sends the GitHub ID to UserCenter, which may produce an incorrect authentication result.

Please align this with CheckUserStatusInUserCenter: resolve the binding for the active UserCenter provider, and leave ExternalID empty when no matching binding exists.

This branch has not been deployed

No deployments
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.

2 participants