Skip to content

Add opt-in personal access token authentication - #31

Merged
scaree merged 9 commits into
mainfrom
85893_mcp_server
Aug 5, 2026
Merged

Add opt-in personal access token authentication#31
scaree merged 9 commits into
mainfrom
85893_mcp_server

Conversation

@scaree

@scaree scaree commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Opt-in "personal_access_token" config section (disabled by default): sha256 hashed bearer tokens bound to a user with expiration, revocation, versioned auth cache, throttled last-used tracking, ownership voter, management controller and console commands for creation and expiry notifications (pluggable notifier interface with a no-op default). The entity ships as a mapped superclass targeting the contracts AnzuUser via resolve_target_entities; the host subclasses it and owns the table, indexes and migration.

scaree added 9 commits July 22, 2026 11:39
Opt-in "personal_access_token" config section (disabled by default): sha256
hashed bearer tokens bound to a user with expiration, revocation, versioned
auth cache, throttled last-used tracking, ownership voter, management
controller and console commands for creation and expiry notifications
(pluggable notifier interface with a no-op default). The entity ships as a
mapped superclass targeting the contracts AnzuUser via resolve_target_entities;
the host subclasses it and owns the table, indexes and migration.
Final constructor makes the class-string instantiation in the facade safe
and getUser() guards the nullable property explicitly.
The user_entity_class validation requires an existing AnzuUser subclass, so
the extension test uses a test entity instead of a nonexistent class name;
the facade test asserts the random token part without mangling the prefix.
…geApiTokenCommand

The personal access token create gate no longer hardcodes ROLE_MCP - hosts
using tokens for non-MCP integrations configure create_role instead. The
pre-existing class_exists guard on EntityManagerInterface never matched an
interface, so ChangeApiTokenCommand was silently unregistered.
Personal access token controller carries attribute routes like the other
auth controllers (host imports them with a prefix) and the expiry notifier
interface lives in Contracts next to the other extension interfaces.
@scaree
scaree merged commit 87ea2f0 into main Aug 5, 2026
2 checks passed
@scaree
scaree deleted the 85893_mcp_server branch August 5, 2026 10:00
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