Skip to content

Commit

Permalink
Add OAuth2Token, OAuth2TokenRevocation, and `OAuth2AuthorizationC…
Browse files Browse the repository at this point in the history
…urrent` to `Route` (#2935)

This adds routes to `Route` that are related to OAuth2 and token exchanges.

This is a step towards resolving #762 and #2475.
  • Loading branch information
valentinegb authored and GnomedDev committed Oct 20, 2024
1 parent f45a30a commit b17c614
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2977,7 +2977,7 @@ impl Http {
multipart: None,
headers: None,
method: LightMethod::Get,
route: Route::Oauth2ApplicationCurrent,
route: Route::OAuth2ApplicationCurrent,
params: None,
})
.await
Expand Down
14 changes: 13 additions & 1 deletion src/http/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,22 @@ routes! ('a, {
api!("/invites/{}", code),
Some(RatelimitingKind::Path);

Oauth2ApplicationCurrent,
OAuth2Token,
api!("/oauth2/token"),
None;

OAuth2TokenRevocation,
api!("/oauth2/token/revoke"),
None;

OAuth2ApplicationCurrent,
api!("/oauth2/applications/@me"),
None;

OAuth2AuthorizationCurrent,
api!("/oauth2/@me"),
None;

StatusIncidentsUnresolved,
status!("/incidents/unresolved.json"),
None;
Expand Down

0 comments on commit b17c614

Please sign in to comment.