|
@@ -19,13 +19,21 @@ struct RootArgs {
|
|
|
|
|
|
#[derive(Debug, Subcommand)]
|
|
|
enum Command {
|
|
|
+ /// database initialization
|
|
|
Init,
|
|
|
+ /// certificate management
|
|
|
Cert(CertArgs),
|
|
|
+ /// OAuth2 client management
|
|
|
Client(ClientArgs),
|
|
|
+ /// general configuration
|
|
|
Config(ConfigArgs),
|
|
|
+ /// permissions grouping management
|
|
|
Group(GroupArgs),
|
|
|
+ /// run the actual OIDC server
|
|
|
Server(ServerArgs),
|
|
|
+ /// manual token generation and inspection
|
|
|
Token(TokenArgs),
|
|
|
+ /// user management
|
|
|
User(UserArgs),
|
|
|
}
|
|
|
|
|
@@ -64,7 +72,7 @@ impl RootArgs {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- println!("Initializing!");
|
|
|
+ log::info!("Initializing!");
|
|
|
|
|
|
let db = microrm::DB::new(
|
|
|
schema::schema(),
|
|
@@ -195,15 +203,13 @@ impl GroupArgs {
|
|
|
struct ServerArgs {
|
|
|
#[clap(short, long)]
|
|
|
port: Option<u16>,
|
|
|
- #[clap(short, long)]
|
|
|
- config_path: Option<String>,
|
|
|
}
|
|
|
|
|
|
impl ServerArgs {
|
|
|
async fn run(&self, root: &RootArgs, db: microrm::DB) {
|
|
|
let config = config::Config::build_from(
|
|
|
&db.query_interface(),
|
|
|
- self.config_path.as_ref().map(|x| x.as_str()),
|
|
|
+ None
|
|
|
);
|
|
|
server::run_server(db, config, self.port.unwrap_or(2114)).await
|
|
|
}
|