Skip to content
Snippets Groups Projects

WIP: enforce totp in keycloak

Closed Levente Polyak requested to merge wip/enforce-totp into master
3 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Makefile 0 → 100644
5 CARGO_OPTIONS := --release --locked
6 CARGO_TARGET := release
7 else
8 CARGO_OPTIONS :=
9 CARGO_TARGET := debug
10 endif
11
12 .PHONY: all gluebuddy lint
13
14 all: gluebuddy lint
15
16 gluebuddy:
17 $(CARGO) build $(CARGO_OPTIONS)
18
19 lint:
20 $(CARGO) check
  • 125
    126 #[tokio::main]
    127 async fn main() {
    128 let args = Args::from_args();
    129
    130 let logging = match args.verbose {
    131 0 => "info",
    132 1 => "gluebuddy=debug",
    133 _ => "debug",
    134 };
    135
    136 env_logger::init_from_env(Env::default()
    137 .default_filter_or(logging));
    138
    139 if let Err(err) = run(args).await {
    140 error!("Error: {:?}", err);
  • 20
    21 async fn get_user_credentials<'a>(admin: &'a KeycloakAdmin<'a>, realm: &str, member: UserRepresentation<'a>) -> Result<(UserRepresentation<'a>, Vec<CredentialRepresentation<'a>>)> {
    22 let credentials = admin.users_credentials_get(realm, member.id.as_ref().unwrap().as_ref()).await?;
    23 Ok((member, credentials))
    24 }
    25
    26 // TODO: error handling for all unwrap shizzle
    27 async fn run(args: Args) -> Result<()> {
    28 match args.subcommand {
    29 Some(SubCommand::Completions(completions)) => args::gen_completions(&completions)?,
    30 _ => run_keycloak(args).await?,
    31 }
    32 Ok(())
    33 }
    34
    35 async fn run_keycloak(args: Args) -> Result<()> {
  • Sweet work overall. Just a few things. :)

  • Levente Polyak added 6 commits

    added 6 commits

    • aa677e87 - adding Makefile with convenience targets for clippy
    • 325a3171 - cargo: adding me to the authors
    • 9b17cb6b - feature: added structopt for option parsing
    • 2be22d54 - license: adding MIT license reference to toml
    • 5e679e2b - cargo: adding some meta data to the toml
    • 62160323 - logging: allow multiple levels of verbosity

    Compare with previous version

  • Levente Polyak added 1 commit

    added 1 commit

    • c2261b66 - modularize command execution

    Compare with previous version

  • Levente Polyak added 1 commit

    added 1 commit

    • d8bebffb - modularize command execution

    Compare with previous version

  • Author Developer

    superseded by !2 (merged)

  • Please register or sign in to reply
    Loading