headless_lms_server/controllers/main_frontend/oauth/
mod.rs

1use actix_web::web::ServiceConfig;
2
3/// OAuth 2.0 and OpenID Connect implementation.
4///
5/// This module implements the following RFCs and specifications:
6///
7/// ## OAuth 2.0 Core
8/// - [RFC 6749 — OAuth 2.0 Authorization Framework](https://datatracker.ietf.org/doc/html/rfc6749)
9///   - §3.1 — Authorization Endpoint (`/authorize`)
10///   - §3.2 — Token Endpoint (`/token`)
11///
12/// ## OAuth 2.0 Extensions
13/// - [RFC 7009 — OAuth 2.0 Token Revocation](https://datatracker.ietf.org/doc/html/rfc7009) (`/revoke`)
14/// - [RFC 7636 — Proof Key for Code Exchange (PKCE)](https://datatracker.ietf.org/doc/html/rfc7636)
15/// - [RFC 7662 — OAuth 2.0 Token Introspection](https://datatracker.ietf.org/doc/html/rfc7662) (`/introspect`)
16/// - [RFC 8414 — OAuth 2.0 Authorization Server Metadata](https://www.rfc-editor.org/rfc/rfc8414) (`/.well-known/openid-configuration`)
17/// - [RFC 9449 — OAuth 2.0 Demonstrating Proof-of-Possession (DPoP)](https://datatracker.ietf.org/doc/html/rfc9449)
18///
19/// ## JSON Web Token (JWT)
20/// - [RFC 7517 — JSON Web Key (JWK)](https://datatracker.ietf.org/doc/html/rfc7517) (`/jwks.json`)
21///
22/// ## OpenID Connect
23/// - [OpenID Connect Core 1.0](https://openid.net/specs/openid-connect-core-1_0.html)
24///   - §3 — Authorization Endpoint (`/authorize`)
25///   - §3.1.3 — Token Endpoint (`/token`)
26///   - §5.3 — UserInfo Endpoint (`/userinfo`)
27///   - §10 — JWKS endpoint for key discovery (`/jwks.json`) — Note: Currently exposes a single key; key rotation not implemented
28/// - [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html) (`/.well-known/openid-configuration`)
29mod authorize;
30mod authorized_clients;
31mod consent;
32mod discovery;
33mod introspect;
34mod revoke;
35mod token;
36mod userinfo;
37
38pub fn _add_routes(cfg: &mut ServiceConfig) {
39    authorize::_add_routes(cfg);
40    token::_add_routes(cfg);
41    userinfo::_add_routes(cfg);
42    discovery::_add_routes(cfg);
43    revoke::_add_routes(cfg);
44    consent::_add_routes(cfg);
45    authorized_clients::_add_routes(cfg);
46    introspect::_add_routes(cfg);
47}