use super::handlers;
use crate::server::state::AppState;
use axum::{
routing::{get, post},
Router,
};
pub fn public_routes() -> Router<AppState> {
Router::new()
.route("/auth/authorize", post(handlers::authorize))
.route("/auth/code/exchange", post(handlers::code_exchange))
.route("/auth/device/exchange", post(handlers::device_exchange))
.route("/auth/signin", get(handlers::signin_page))
.route("/auth/signin/start", get(handlers::oauth_signin_start))
.route("/auth/callback", get(handlers::oauth_callback))
.route("/auth/ingress", get(handlers::ingress_auth))
.route("/auth/logout", get(handlers::oauth_logout))
.route("/auth/cli-success", get(handlers::cli_auth_success))
.route("/auth/jwks", get(handlers::jwks))
}
pub fn well_known_routes() -> Router<AppState> {
Router::new().route(
"/.well-known/openid-configuration",
get(handlers::openid_configuration),
)
}
pub fn rise_auth_routes() -> Router<AppState> {
Router::new()
.route("/.rise/auth/signin", get(handlers::signin_page))
.route(
"/.rise/auth/signin/start",
get(handlers::oauth_signin_start),
)
.route("/.rise/auth/complete", get(handlers::oauth_complete))
}
pub fn auth_only_routes() -> Router<AppState> {
Router::new().route("/users/me", get(handlers::me))
}
pub fn platform_routes() -> Router<AppState> {
Router::new().route("/users/lookup", post(handlers::users_lookup))
}