|
@@ -1,7 +1,8 @@
|
|
use crate::{
|
|
use crate::{
|
|
- client_management, config, group_management, key,
|
|
|
|
- schema::{self, RealmID},
|
|
|
|
- scope_management, server, token, token_management, user_management, UIDCError,
|
|
|
|
|
|
+ schema::{self, UIDCDatabase},
|
|
|
|
+ config,
|
|
|
|
+ UIDCError,
|
|
|
|
+ key, user_management, client_management, scope_management, group_management, token_management,
|
|
};
|
|
};
|
|
use clap::{Parser, Subcommand};
|
|
use clap::{Parser, Subcommand};
|
|
use microrm::prelude::*;
|
|
use microrm::prelude::*;
|
|
@@ -33,10 +34,12 @@ enum Command {
|
|
Group(GroupArgs),
|
|
Group(GroupArgs),
|
|
/// key management
|
|
/// key management
|
|
Key(KeyArgs),
|
|
Key(KeyArgs),
|
|
- /// run the actual OIDC server
|
|
|
|
|
|
+ /// scope management
|
|
Scope(ScopeArgs),
|
|
Scope(ScopeArgs),
|
|
|
|
+ /*
|
|
/// run the actual OIDC server
|
|
/// run the actual OIDC server
|
|
Server(ServerArgs),
|
|
Server(ServerArgs),
|
|
|
|
+ */
|
|
/// manual token generation and inspection
|
|
/// manual token generation and inspection
|
|
Token(TokenArgs),
|
|
Token(TokenArgs),
|
|
/// role management
|
|
/// role management
|
|
@@ -46,8 +49,8 @@ enum Command {
|
|
}
|
|
}
|
|
|
|
|
|
struct RunArgs {
|
|
struct RunArgs {
|
|
- db: microrm::DB,
|
|
|
|
- realm_id: RealmID,
|
|
|
|
|
|
+ db: UIDCDatabase,
|
|
|
|
+ realm: schema::Realm,
|
|
}
|
|
}
|
|
|
|
|
|
impl RootArgs {
|
|
impl RootArgs {
|
|
@@ -56,64 +59,68 @@ impl RootArgs {
|
|
return self.init().await;
|
|
return self.init().await;
|
|
}
|
|
}
|
|
|
|
|
|
- let db = microrm::DB::new(schema::schema(), &self.db, microrm::CreateMode::MustExist)
|
|
|
|
|
|
+ let db = UIDCDatabase::open_path(&self.db)
|
|
.map_err(|e| UIDCError::AbortString(format!("Error accessing database: {:?}", e)))?;
|
|
.map_err(|e| UIDCError::AbortString(format!("Error accessing database: {:?}", e)))?;
|
|
|
|
|
|
- let realm_id = db
|
|
|
|
- .query_interface()
|
|
|
|
- .get()
|
|
|
|
- .by(schema::Realm::Shortname, self.realm.as_str())
|
|
|
|
- .one()?
|
|
|
|
- .ok_or(UIDCError::Abort("no such realm"))?
|
|
|
|
- .id();
|
|
|
|
|
|
+ let realm =
|
|
|
|
+ db
|
|
|
|
+ .realms
|
|
|
|
+ .unique(&self.realm)
|
|
|
|
+ .get()?
|
|
|
|
+ .ok_or(UIDCError::Abort("no such realm"))?;
|
|
|
|
|
|
- let ra = RunArgs { db: db, realm_id };
|
|
|
|
|
|
+ let ra = RunArgs { db: db, realm: realm.wrapped() };
|
|
|
|
|
|
match &self.command {
|
|
match &self.command {
|
|
Command::Init => unreachable!(),
|
|
Command::Init => unreachable!(),
|
|
Command::Config(v) => v.run(ra).await,
|
|
Command::Config(v) => v.run(ra).await,
|
|
- Command::Client(v) => v.run(ra).await,
|
|
|
|
- Command::Group(v) => v.run(ra).await,
|
|
|
|
Command::Key(v) => v.run(ra).await,
|
|
Command::Key(v) => v.run(ra).await,
|
|
|
|
+ Command::Client(v) => v.run(ra).await,
|
|
Command::Scope(v) => v.run(ra).await,
|
|
Command::Scope(v) => v.run(ra).await,
|
|
- Command::Server(v) => v.run(ra).await,
|
|
|
|
|
|
+ Command::Group(v) => v.run(ra).await,
|
|
|
|
+ /*Command::Server(v) => v.run(ra).await,*/
|
|
Command::Token(v) => v.run(ra).await,
|
|
Command::Token(v) => v.run(ra).await,
|
|
Command::Role(v) => v.run(ra).await,
|
|
Command::Role(v) => v.run(ra).await,
|
|
Command::User(v) => v.run(ra).await,
|
|
Command::User(v) => v.run(ra).await,
|
|
|
|
+ _ => todo!(),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
async fn init(&self) -> Result<(), UIDCError> {
|
|
async fn init(&self) -> Result<(), UIDCError> {
|
|
// first check to see if the database is already vaguely set up
|
|
// first check to see if the database is already vaguely set up
|
|
- let maybedb = microrm::DB::new(schema::schema(), &self.db, microrm::CreateMode::MustExist);
|
|
|
|
-
|
|
|
|
- if maybedb.is_ok() {
|
|
|
|
- return Err(UIDCError::Abort(
|
|
|
|
- "Database already initialized, not overwriting!",
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ let db = UIDCDatabase::open_path(&self.db)
|
|
|
|
+ .map_err(|e| UIDCError::AbortString(format!("Error accessing database: {:?}", e)))?;
|
|
|
|
|
|
log::info!("Initializing!");
|
|
log::info!("Initializing!");
|
|
|
|
|
|
- let db = microrm::DB::new(
|
|
|
|
- schema::schema(),
|
|
|
|
- &self.db,
|
|
|
|
- microrm::CreateMode::AllowNewDatabase,
|
|
|
|
- )
|
|
|
|
- .expect("Unable to initialize database!");
|
|
|
|
|
|
+ let primary_realm = "primary".to_string();
|
|
|
|
+
|
|
|
|
+ if db.realms.unique(&primary_realm).get()?.is_some() {
|
|
|
|
+ log::warn!("Already initialized with primary realm!");
|
|
|
|
+ return Ok(())
|
|
|
|
+ }
|
|
|
|
|
|
// create primary realm
|
|
// create primary realm
|
|
- db.query_interface().add(&schema::Realm {
|
|
|
|
- shortname: "primary".to_string(),
|
|
|
|
|
|
+ db.realms.insert(schema::Realm {
|
|
|
|
+ shortname: primary_realm,
|
|
|
|
+ ..Default::default()
|
|
})?;
|
|
})?;
|
|
|
|
+
|
|
Ok(())
|
|
Ok(())
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
#[derive(Debug, Subcommand)]
|
|
#[derive(Debug, Subcommand)]
|
|
enum KeyCommand {
|
|
enum KeyCommand {
|
|
- Inspect,
|
|
|
|
- Generate,
|
|
|
|
|
|
+ /// Print details of all keys
|
|
|
|
+ List,
|
|
|
|
+ /// Generate a new key; see types subcommand for valid options.
|
|
|
|
+ Generate { keytype: String },
|
|
|
|
+ /// List what keytypes are supported
|
|
|
|
+ Types,
|
|
|
|
+ /// Remove a key from use
|
|
|
|
+ Remove { key_id: String },
|
|
}
|
|
}
|
|
|
|
|
|
#[derive(Debug, Parser)]
|
|
#[derive(Debug, Parser)]
|
|
@@ -125,8 +132,25 @@ struct KeyArgs {
|
|
impl KeyArgs {
|
|
impl KeyArgs {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
match &self.command {
|
|
match &self.command {
|
|
- KeyCommand::Inspect => key::inspect(&args.db, args.realm_id),
|
|
|
|
- KeyCommand::Generate => key::generate(&args.db, args.realm_id),
|
|
|
|
|
|
+ KeyCommand::List => key::list(&args.realm),
|
|
|
|
+ KeyCommand::Generate { keytype } => {
|
|
|
|
+ for (spec, kty) in key::KEY_TYPE_NAMES {
|
|
|
|
+ if keytype == spec {
|
|
|
|
+ key::generate_in(&args.realm, *kty)?;
|
|
|
|
+ return Ok(())
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Err(UIDCError::Abort("invalid keytype; try running `uidc key types`"))
|
|
|
|
+ },
|
|
|
|
+ KeyCommand::Types => {
|
|
|
|
+ for (spec, _kty) in key::KEY_TYPE_NAMES {
|
|
|
|
+ println!("- {}", spec);
|
|
|
|
+ }
|
|
|
|
+ Ok(())
|
|
|
|
+ }
|
|
|
|
+ KeyCommand::Remove { key_id } => {
|
|
|
|
+ key::remove(&args.realm, key_id)
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -148,13 +172,13 @@ impl ClientArgs {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
match &self.command {
|
|
match &self.command {
|
|
ClientCommand::Create { name } => {
|
|
ClientCommand::Create { name } => {
|
|
- client_management::create(&args.db, args.realm_id, name)
|
|
|
|
|
|
+ client_management::create(&args.realm, name)
|
|
}
|
|
}
|
|
ClientCommand::List => {
|
|
ClientCommand::List => {
|
|
todo!()
|
|
todo!()
|
|
}
|
|
}
|
|
ClientCommand::Inspect { name } => {
|
|
ClientCommand::Inspect { name } => {
|
|
- client_management::inspect(&args.db, args.realm_id, name)
|
|
|
|
|
|
+ client_management::inspect(&args.realm, name)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -175,23 +199,20 @@ struct ConfigArgs {
|
|
|
|
|
|
impl ConfigArgs {
|
|
impl ConfigArgs {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
- let qi = args.db.query_interface();
|
|
|
|
-
|
|
|
|
match &self.command {
|
|
match &self.command {
|
|
ConfigCommand::Dump => {
|
|
ConfigCommand::Dump => {
|
|
- let config = config::Config::build_from(&qi, None);
|
|
|
|
- println!("config: {:?}", config);
|
|
|
|
|
|
+ let config = config::Config::build_from(&args.db, None);
|
|
|
|
+ println!("{:?}", config);
|
|
}
|
|
}
|
|
ConfigCommand::Set { key, value } => {
|
|
ConfigCommand::Set { key, value } => {
|
|
- qi.delete().by(schema::PersistentConfig::Key, &key).exec()?;
|
|
|
|
- qi.insert(&schema::PersistentConfig {
|
|
|
|
- key: key.clone(),
|
|
|
|
- value: value.clone(),
|
|
|
|
|
|
+ args.db.persistent_config.unique(key).delete()?;
|
|
|
|
+ args.db.persistent_config.insert(schema::PersistentConfig {
|
|
|
|
+ key: key.clone(), value: value.clone()
|
|
})?;
|
|
})?;
|
|
}
|
|
}
|
|
ConfigCommand::Load { toml_path } => {
|
|
ConfigCommand::Load { toml_path } => {
|
|
- let config = config::Config::build_from(&qi, Some(toml_path));
|
|
|
|
- config.save(&qi);
|
|
|
|
|
|
+ let config = config::Config::build_from(&args.db, Some(toml_path));
|
|
|
|
+ config.save(&args.db);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Ok(())
|
|
Ok(())
|
|
@@ -236,29 +257,27 @@ struct GroupArgs {
|
|
|
|
|
|
impl GroupArgs {
|
|
impl GroupArgs {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
- let qi = args.db.query_interface();
|
|
|
|
match &self.command {
|
|
match &self.command {
|
|
GroupCommand::Create { group_name } => {
|
|
GroupCommand::Create { group_name } => {
|
|
- group_management::create_group(&qi, args.realm_id, group_name)?;
|
|
|
|
|
|
+ group_management::create_group(&args.realm, group_name)?;
|
|
}
|
|
}
|
|
GroupCommand::Members { group_name } => {
|
|
GroupCommand::Members { group_name } => {
|
|
- group_management::list_members(&qi, args.realm_id, group_name.as_str())?;
|
|
|
|
|
|
+ group_management::list_members(&args.realm, group_name)?;
|
|
}
|
|
}
|
|
GroupCommand::Roles { group_name } => {
|
|
GroupCommand::Roles { group_name } => {
|
|
- group_management::list_roles(&qi, args.realm_id, group_name.as_str())?;
|
|
|
|
|
|
+ group_management::list_roles(&args.realm, group_name)?;
|
|
}
|
|
}
|
|
GroupCommand::List => {
|
|
GroupCommand::List => {
|
|
- group_management::list_groups(&qi, args.realm_id)?;
|
|
|
|
|
|
+ group_management::list_groups(&args.realm)?;
|
|
}
|
|
}
|
|
GroupCommand::AttachRole {
|
|
GroupCommand::AttachRole {
|
|
group_name,
|
|
group_name,
|
|
role_name,
|
|
role_name,
|
|
} => {
|
|
} => {
|
|
group_management::attach_role(
|
|
group_management::attach_role(
|
|
- &qi,
|
|
|
|
- args.realm_id,
|
|
|
|
- group_name.as_str(),
|
|
|
|
- role_name.as_str(),
|
|
|
|
|
|
+ &args.realm,
|
|
|
|
+ group_name,
|
|
|
|
+ role_name,
|
|
)?;
|
|
)?;
|
|
}
|
|
}
|
|
GroupCommand::DetachRole {
|
|
GroupCommand::DetachRole {
|
|
@@ -266,10 +285,9 @@ impl GroupArgs {
|
|
role_name,
|
|
role_name,
|
|
} => {
|
|
} => {
|
|
group_management::detach_role(
|
|
group_management::detach_role(
|
|
- &qi,
|
|
|
|
- args.realm_id,
|
|
|
|
- group_name.as_str(),
|
|
|
|
- role_name.as_str(),
|
|
|
|
|
|
+ &args.realm,
|
|
|
|
+ group_name,
|
|
|
|
+ role_name,
|
|
)?;
|
|
)?;
|
|
}
|
|
}
|
|
GroupCommand::AttachUser {
|
|
GroupCommand::AttachUser {
|
|
@@ -277,10 +295,9 @@ impl GroupArgs {
|
|
username,
|
|
username,
|
|
} => {
|
|
} => {
|
|
group_management::attach_user(
|
|
group_management::attach_user(
|
|
- &qi,
|
|
|
|
- args.realm_id,
|
|
|
|
- group_name.as_str(),
|
|
|
|
- username.as_str(),
|
|
|
|
|
|
+ &args.realm,
|
|
|
|
+ group_name,
|
|
|
|
+ username,
|
|
)?;
|
|
)?;
|
|
}
|
|
}
|
|
GroupCommand::DetachUser {
|
|
GroupCommand::DetachUser {
|
|
@@ -288,10 +305,9 @@ impl GroupArgs {
|
|
username,
|
|
username,
|
|
} => {
|
|
} => {
|
|
group_management::detach_user(
|
|
group_management::detach_user(
|
|
- &qi,
|
|
|
|
- args.realm_id,
|
|
|
|
- group_name.as_str(),
|
|
|
|
- username.as_str(),
|
|
|
|
|
|
+ &args.realm,
|
|
|
|
+ group_name,
|
|
|
|
+ username,
|
|
)?;
|
|
)?;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -326,37 +342,35 @@ struct ScopeArgs {
|
|
|
|
|
|
impl ScopeArgs {
|
|
impl ScopeArgs {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
- let qi = args.db.query_interface();
|
|
|
|
match &self.command {
|
|
match &self.command {
|
|
ScopeCommand::AttachRole {
|
|
ScopeCommand::AttachRole {
|
|
scope_name,
|
|
scope_name,
|
|
role_name,
|
|
role_name,
|
|
} => scope_management::attach_role(
|
|
} => scope_management::attach_role(
|
|
- &qi,
|
|
|
|
- args.realm_id,
|
|
|
|
- scope_name.as_str(),
|
|
|
|
- role_name.as_str(),
|
|
|
|
|
|
+ &args.realm,
|
|
|
|
+ scope_name,
|
|
|
|
+ role_name,
|
|
),
|
|
),
|
|
ScopeCommand::Create { scope_name } => {
|
|
ScopeCommand::Create { scope_name } => {
|
|
- scope_management::create_scope(&qi, args.realm_id, scope_name.as_str())
|
|
|
|
|
|
+ scope_management::create_scope(&args.realm, scope_name)
|
|
}
|
|
}
|
|
ScopeCommand::DetachRole {
|
|
ScopeCommand::DetachRole {
|
|
scope_name,
|
|
scope_name,
|
|
role_name,
|
|
role_name,
|
|
} => scope_management::detach_role(
|
|
} => scope_management::detach_role(
|
|
- &qi,
|
|
|
|
- args.realm_id,
|
|
|
|
- scope_name.as_str(),
|
|
|
|
- role_name.as_str(),
|
|
|
|
|
|
+ &args.realm,
|
|
|
|
+ scope_name,
|
|
|
|
+ role_name,
|
|
),
|
|
),
|
|
ScopeCommand::Inspect { scope_name } => {
|
|
ScopeCommand::Inspect { scope_name } => {
|
|
- scope_management::inspect_scope(&qi, args.realm_id, scope_name.as_str())
|
|
|
|
|
|
+ scope_management::inspect_scope(&args.realm, scope_name)
|
|
}
|
|
}
|
|
- ScopeCommand::List => scope_management::list_scopes(&qi, args.realm_id),
|
|
|
|
|
|
+ ScopeCommand::List => scope_management::list_scopes(&args.realm),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/*
|
|
#[derive(Debug, Parser)]
|
|
#[derive(Debug, Parser)]
|
|
struct ServerArgs {
|
|
struct ServerArgs {
|
|
#[clap(short, long)]
|
|
#[clap(short, long)]
|
|
@@ -369,6 +383,7 @@ impl ServerArgs {
|
|
server::run_server(args.db, config, self.port.unwrap_or(2114)).await
|
|
server::run_server(args.db, config, self.port.unwrap_or(2114)).await
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+*/
|
|
|
|
|
|
#[derive(Debug, Subcommand)]
|
|
#[derive(Debug, Subcommand)]
|
|
enum TokenCommand {
|
|
enum TokenCommand {
|
|
@@ -401,8 +416,7 @@ struct TokenArgs {
|
|
|
|
|
|
impl TokenArgs {
|
|
impl TokenArgs {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
- let config = config::Config::build_from(&args.db.query_interface(), None);
|
|
|
|
- let qi = args.db.query_interface();
|
|
|
|
|
|
+ let config = config::Config::build_from(&args.db, None);
|
|
match &self.command {
|
|
match &self.command {
|
|
TokenCommand::GenerateAuth {
|
|
TokenCommand::GenerateAuth {
|
|
client,
|
|
client,
|
|
@@ -410,12 +424,11 @@ impl TokenArgs {
|
|
scopes,
|
|
scopes,
|
|
} => {
|
|
} => {
|
|
let token = token_management::create_auth_token(
|
|
let token = token_management::create_auth_token(
|
|
- &qi,
|
|
|
|
|
|
+ &args.realm,
|
|
&config,
|
|
&config,
|
|
- args.realm_id,
|
|
|
|
- client.as_str(),
|
|
|
|
- username.as_str(),
|
|
|
|
- scopes.as_str(),
|
|
|
|
|
|
+ client,
|
|
|
|
+ username,
|
|
|
|
+ scopes,
|
|
)?;
|
|
)?;
|
|
println!("{}", token);
|
|
println!("{}", token);
|
|
Ok(())
|
|
Ok(())
|
|
@@ -426,20 +439,18 @@ impl TokenArgs {
|
|
scopes,
|
|
scopes,
|
|
} => {
|
|
} => {
|
|
let token = token_management::create_refresh_token(
|
|
let token = token_management::create_refresh_token(
|
|
- &qi,
|
|
|
|
|
|
+ &args.realm,
|
|
&config,
|
|
&config,
|
|
- args.realm_id,
|
|
|
|
- client.as_str(),
|
|
|
|
- username.as_str(),
|
|
|
|
- scopes.as_str(),
|
|
|
|
|
|
+ client,
|
|
|
|
+ username,
|
|
|
|
+ scopes,
|
|
)?;
|
|
)?;
|
|
println!("{}", token);
|
|
println!("{}", token);
|
|
Ok(())
|
|
Ok(())
|
|
}
|
|
}
|
|
TokenCommand::Inspect { token } => token_management::inspect_token(
|
|
TokenCommand::Inspect { token } => token_management::inspect_token(
|
|
- &qi,
|
|
|
|
&config,
|
|
&config,
|
|
- args.realm_id,
|
|
|
|
|
|
+ &args.realm,
|
|
token.as_ref().map(|s| s.as_str()),
|
|
token.as_ref().map(|s| s.as_str()),
|
|
),
|
|
),
|
|
}
|
|
}
|
|
@@ -461,11 +472,12 @@ struct RoleArgs {
|
|
|
|
|
|
impl RoleArgs {
|
|
impl RoleArgs {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
- let qi = args.db.query_interface();
|
|
|
|
match &self.command {
|
|
match &self.command {
|
|
RoleCommand::List => {
|
|
RoleCommand::List => {
|
|
todo!()
|
|
todo!()
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ _ => todo!(),
|
|
|
|
+ /*
|
|
RoleCommand::Create { name } => {
|
|
RoleCommand::Create { name } => {
|
|
let add_result = qi.add(&schema::Role {
|
|
let add_result = qi.add(&schema::Role {
|
|
realm: args.realm_id,
|
|
realm: args.realm_id,
|
|
@@ -487,6 +499,7 @@ impl RoleArgs {
|
|
.by(schema::Role::Shortname, name.as_str())
|
|
.by(schema::Role::Shortname, name.as_str())
|
|
.exec()?;
|
|
.exec()?;
|
|
}
|
|
}
|
|
|
|
+ */
|
|
}
|
|
}
|
|
Ok(())
|
|
Ok(())
|
|
}
|
|
}
|
|
@@ -520,25 +533,23 @@ struct UserArgs {
|
|
|
|
|
|
impl UserArgs {
|
|
impl UserArgs {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
async fn run(&self, args: RunArgs) -> Result<(), UIDCError> {
|
|
- let qi = args.db.query_interface();
|
|
|
|
match &self.command {
|
|
match &self.command {
|
|
- UserCommand::List => user_management::list(&qi, args.realm_id),
|
|
|
|
|
|
+ UserCommand::List => user_management::list(&args.realm),
|
|
UserCommand::Create { username } => {
|
|
UserCommand::Create { username } => {
|
|
- user_management::create(&qi, args.realm_id, username.as_str())
|
|
|
|
|
|
+ user_management::create(&args.realm, username)
|
|
}
|
|
}
|
|
UserCommand::Auth {
|
|
UserCommand::Auth {
|
|
username,
|
|
username,
|
|
change_password,
|
|
change_password,
|
|
change_totp,
|
|
change_totp,
|
|
} => user_management::change_auth(
|
|
} => user_management::change_auth(
|
|
- &qi,
|
|
|
|
- args.realm_id,
|
|
|
|
- username.as_str(),
|
|
|
|
|
|
+ &args.realm,
|
|
|
|
+ username,
|
|
*change_password > 0,
|
|
*change_password > 0,
|
|
*change_totp > 0,
|
|
*change_totp > 0,
|
|
),
|
|
),
|
|
UserCommand::Inspect { username } => {
|
|
UserCommand::Inspect { username } => {
|
|
- user_management::inspect(&qi, args.realm_id, username.as_str())
|
|
|
|
|
|
+ user_management::inspect(&args.realm, username)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -554,3 +565,5 @@ pub fn invoked() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|