feat(oauth): issue the api key self-serve at app creation with abuse guardrails - #63
Merged
Merged
Conversation
…guardrails App creation minted an api key but discarded the plaintext, so a usable activation-API key required the admin-approved /request-bearer flow. Creation now returns the api key alongside the client secret (one-time display), gated by a verified email, a 5/hour rate limit, and a cap of 10 active apps per user, and records an oauth_client_created security event. The admin oauth-clients panel gains a live-application list with disable/enable, the first admin control over a live client.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal: create your own application without requiring admin approval. App creation already needed none for the OAuth client, but the activation-API key it minted was discarded, so a usable key required the admin-approved /request-bearer Telegram flow.
createAppActionreturns the api key alongside the client secret (one-time display on the creation screen), gated by a verified email, a 5/hour per-user rate limit, and a cap of 10 active apps per owner; creation records anoauth_client_createdsecurity event.setExternalAppStatus- the first admin control over a live client. Apps the owner permanently revoked through the bearer flow are tagged and cannot be re-enabled, so an admin tidying the panel cannot silently resurrect a credential its owner believes dead.getActivationForUser/approveActivationForUsertreat a non-active app as expired, so already-sent consent links stop working at disable time instead of surviving until their TTL./developers/oauthsection 14.0,/request-bearer) now point at the self-serve path; the admin-review flow remains available.Review attention and accepted tradeoffs: