You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a6e995a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(auth): withdraw an authorized AI assistant, own and admin doors
POST /api/v1/auth/authorized-clients/withdraw { id } withdraws one of the
session user's own OAuth consents; POST /api/v1/auth/admin/authorized-clients/withdraw
{ userId, id } does the same for a platform administrator behind the admin
read's gate. Both revoke the grant the way /oauth2/revoke does (consent row,
then the client's refresh family), so the assistant's token is refused on its
next MCP call. Unknown and not-yours answer one 404. Ledgered as sdk with
oauth.authorizedClients.withdraw / withdrawForUser on the client.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibxU7nr4BXM7e8qMfwq
{route: 'POST /api/v1/auth/oauth2/delete-consent',family: 'oauth-provider',source: 'better-auth',disposition: 'server-only',requires: 'oidcProvider',note: 'no SDK method builds this URL — the withdraw door is POST /authorized-clients/withdraw. Measured on @better-auth/oauth-provider 1.7.12: the vendor route does check the consent is the session user\'s, but answers an unknown id 404 and another person\'s id 401, so the two can be told apart, and it leaves the client\'s refresh family in place; the ObjectStack door answers both the same 404 and revokes the whole grant'},
// is registered whether or not it is enabled, so both are unconditional
197
198
// mounts and carry no `requires`.
198
199
{route: 'GET /api/v1/auth/admin/authorized-clients',family: 'objectstack-mount',source: 'objectstack',disposition: 'sdk',client: 'oauth.authorizedClients.listForUser',note: 'another person\'s authorized AI assistants, ?userId=ID: platform-admin gated exactly as the admin session doors are (ADR-0068 D2, a held session refused per ADR-0069 D3), the gate run before the query is read, so a caller outside that reach is refused once whether or not the person exists; an organization owner or admin is not a platform admin and is refused. Every organization the person granted in, each row naming its organizationId. Read only. Closed query set {userId}: missing, empty or repeated is 400, an id naming no user is 404'},
199
-
{route: 'GET /api/v1/auth/authorized-clients',family: 'objectstack-mount',source: 'objectstack',disposition: 'sdk',client: 'oauth.authorizedClients.list',note: 'the caller\'s own authorized AI assistants (OAuth consents), keyed by the session\'s subject and nothing else: the query set is closed and empty, so a userId or any other parameter is refused 400 rather than ignored. Each row: consent id (the key /oauth2/delete-consent takes), clientId, name, scopes, organizationId, authorizedAt, lastUsedAt (start of the most recent hour with a verified MCP call, null when none is recorded); no token, code, secret or session value. Newest first, at most 200 rows with truncated saying when there are more; Cache-Control: no-store'},
200
+
{route: 'POST /api/v1/auth/admin/authorized-clients/withdraw',family: 'objectstack-mount',source: 'objectstack',disposition: 'sdk',client: 'oauth.authorizedClients.withdrawForUser',note: 'withdraw one of another person\'s authorized AI assistants, body { userId, id }: behind the same gate as GET /admin/authorized-clients (ADR-0068 D2, a held session refused per ADR-0069 D3), run before the body is read, so a caller outside that reach is refused once whether or not the person or the consent exists; an organization owner or admin is not a platform admin and is refused. A userId naming no user is 404 with the read\'s message; a consent that is not that person\'s reads the same 404 as one that does not exist. The same revoke as the own door'},
201
+
{route: 'GET /api/v1/auth/authorized-clients',family: 'objectstack-mount',source: 'objectstack',disposition: 'sdk',client: 'oauth.authorizedClients.list',note: 'the caller\'s own authorized AI assistants (OAuth consents), keyed by the session\'s subject and nothing else: the query set is closed and empty, so a userId or any other parameter is refused 400 rather than ignored. Each row: consent id (the key POST /authorized-clients/withdraw takes), clientId, name, scopes, organizationId, authorizedAt, lastUsedAt (start of the most recent hour with a verified MCP call, null when none is recorded); no token, code, secret or session value. Newest first, at most 200 rows with truncated saying when there are more; Cache-Control: no-store'},
202
+
{route: 'POST /api/v1/auth/authorized-clients/withdraw',family: 'objectstack-mount',source: 'objectstack',disposition: 'sdk',client: 'oauth.authorizedClients.withdraw',note: 'withdraw one of the caller\'s own authorized AI assistants by the consent id the authorized-clients read answers, body { id } and nothing else (the query set is closed and empty, an unknown body key is 400): keyed by the session\'s subject, so an id naming no consent and an id naming another person\'s consent read the same 404 RESOURCE_NOT_FOUND and the other row stays. Revokes the grant as /oauth2/revoke does (cloud#3606 ruling A): the consent row, then the client\'s refresh family, so the assistant\'s token is refused on its next MCP call. Answers { id }; Cache-Control: no-store'},
0 commit comments