diff options
| author | 2025-04-10 16:24:17 +0200 | |
|---|---|---|
| committer | 2025-04-10 16:24:17 +0200 | |
| commit | e032c959e13bc276d8517a51857e1c772c151f95 (patch) | |
| tree | 04b33f2202c56ff340246ebeb67d1550c821380e /internal/processing | |
| parent | [chore] add IPPrefixes type so we don't need separate rate limit parsed field... (diff) | |
| download | gotosocial-e032c959e13bc276d8517a51857e1c772c151f95.tar.xz | |
[feature] Implement /oauth/revoke for token revocation (#3983)
Diffstat (limited to 'internal/processing')
| -rw-r--r-- | internal/processing/oauth.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/processing/oauth.go b/internal/processing/oauth.go index 6cd7e00cf..d597a6dc6 100644 --- a/internal/processing/oauth.go +++ b/internal/processing/oauth.go @@ -18,6 +18,7 @@ package processing import ( + "context" "net/http" "codeberg.org/superseriousbusiness/oauth2/v4" @@ -38,3 +39,17 @@ func (p *Processor) OAuthValidateBearerToken(r *http.Request) (oauth2.TokenInfo, // todo: some kind of metrics stuff here return p.oauthServer.ValidationBearerToken(r) } + +func (p *Processor) OAuthRevokeAccessToken( + ctx context.Context, + clientID string, + clientSecret string, + accessToken string, +) gtserror.WithCode { + return p.oauthServer.RevokeAccessToken( + ctx, + clientID, + clientSecret, + accessToken, + ) +} |
