mirror of
https://github.com/kanidm/kanidm.git
synced 2025-05-17 22:43:55 +02:00
Change OAuth2 RS Origin from the CLI (#2418)
* Enable changing the origin of an OAuth2 RS
This commit is contained in:
parent
38f930c981
commit
d56691f12d
|
@ -28,6 +28,7 @@ impl Oauth2Opt {
|
|||
Oauth2Opt::CreateBasic { copt, .. } | Oauth2Opt::CreatePublic { copt, .. } => {
|
||||
copt.debug
|
||||
}
|
||||
Oauth2Opt::SetOrigin { nopt, .. } => nopt.copt.debug,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -305,6 +306,25 @@ impl Oauth2Opt {
|
|||
Err(e) => handle_client_error(e, nopt.copt.output_mode),
|
||||
}
|
||||
}
|
||||
Oauth2Opt::SetOrigin { nopt, origin } => {
|
||||
let client = nopt.copt.to_client(OpType::Write).await;
|
||||
match client
|
||||
.idm_oauth2_rs_update(
|
||||
&nopt.name,
|
||||
None,
|
||||
None,
|
||||
Some(origin),
|
||||
None,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(_) => println!("Success"),
|
||||
Err(e) => handle_client_error(e, nopt.copt.output_mode),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -905,6 +905,14 @@ pub enum Oauth2Opt {
|
|||
#[clap(name = "prefer-spn-username")]
|
||||
/// Use the 'spn' attribute instead of 'name' for the preferred_username
|
||||
PreferSPNUsername(Named),
|
||||
/// Set the origin of a client
|
||||
#[clap(name = "set-origin")]
|
||||
SetOrigin {
|
||||
#[clap(flatten)]
|
||||
nopt: Named,
|
||||
#[clap(name = "origin")]
|
||||
origin: String,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Args, Debug)]
|
||||
|
|
Loading…
Reference in a new issue