mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 20:56:49 +00:00
feat: Implement oauth auth code and refresh token flows
This commit is contained in:
37 files changed
+1057
-157
No files matched your search
@@ -1,17 +1,31 @@
|
||||
mod register_client;
|
||||
mod server_metadata;
|
||||
mod token;
|
||||
|
||||
use axum::{
|
||||
Json, Router,
|
||||
extract::State,
|
||||
routing::method_routing::{get, post},
|
||||
};
|
||||
use serde_json::json;
|
||||
pub(crate) use server_metadata::*;
|
||||
|
||||
pub(crate) const BASE_PATH: &str = "/_continuwuity/oauth2/";
|
||||
const BASE_PATH: &str = "/_continuwuity/oauth2/";
|
||||
|
||||
pub(crate) fn router() -> Router<crate::State> {
|
||||
Router::new().nest(BASE_PATH, oauth_router())
|
||||
// TODO(unspecced): used by old versions of the matrix-js-sdk
|
||||
// .route("/.well-known/openid-configuration", get(
|
||||
// async |State(services): State<crate::State>| {
|
||||
// Json(authorization_server_metadata(&services).await)
|
||||
// }
|
||||
// ))
|
||||
}
|
||||
|
||||
fn oauth_router() -> Router<crate::State> {
|
||||
Router::new()
|
||||
.route("/client/register", post(register_client::register_client_route))
|
||||
// TODO(unspecced): used by old versions of the matrix-js-sdk
|
||||
.route("/client/keys.json", get(async || Json(json!({"keys": []}))))
|
||||
.route("/grant/token", post(token::token_route))
|
||||
}
|
||||
Reference in new issue
Block a user