feat: Initial implementation of OIDC

This commit is contained in:
Ginger committed 2026-07-02 16:34:38 -04:00
1 parent 69163b5391
commit c0cb4afd8a
32 files changed
+1300 -63

No files matched your search

+15 -1
View File
@@ -1,5 +1,5 @@
use clap::Parser;
use conduwuit::Result;
use conduwuit::{Err, Result};
use crate::{
appservice::{self, AppserviceCommand},
@@ -8,6 +8,7 @@ use crate::{
debug::{self, DebugCommand},
federation::{self, FederationCommand},
media::{self, MediaCommand},
oidc::{self, OidcCommand},
query::{self, QueryCommand},
room::{self, RoomCommand},
server::{self, ServerCommand},
@@ -30,6 +31,9 @@ pub enum AdminCommand {
/// Commands for managing registration tokens
Token(TokenCommand),
#[command(subcommand)]
Oidc(OidcCommand),
#[command(subcommand)]
/// Commands for managing rooms
Rooms(RoomCommand),
@@ -80,6 +84,16 @@ pub(super) async fn process(command: AdminCommand, context: &Context<'_>) -> Res
context.bail_restricted()?;
token::process(command, context).await
},
| Oidc(command) => {
// OIDC commands are all restricted
context.bail_restricted()?;
if !context.services.oidc.enabled() {
return Err!("OIDC is not configured");
}
oidc::process(command, context).await
},
| Rooms(command) => room::process(command, context).await,
| Federation(command) => federation::process(command, context).await,
| Server(command) => server::process(command, context).await,