diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-28 22:04:45 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-28 22:04:45 -0800 |
commit | d50f7729cbc86c62dba9bd4db80786f07b44a7c0 (patch) | |
tree | 992677218f37dbd58fbf3ac7bb6035e3a57a1104 /rust/src/bin/fatcat-auth.rs | |
parent | f9408344464285870409c2209a8edc8d25fd9bfa (diff) | |
download | fatcat-d50f7729cbc86c62dba9bd4db80786f07b44a7c0.tar.gz fatcat-d50f7729cbc86c62dba9bd4db80786f07b44a7c0.zip |
more auth refactoring
Diffstat (limited to 'rust/src/bin/fatcat-auth.rs')
-rw-r--r-- | rust/src/bin/fatcat-auth.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/src/bin/fatcat-auth.rs b/rust/src/bin/fatcat-auth.rs index f11f7a67..4b90da74 100644 --- a/rust/src/bin/fatcat-auth.rs +++ b/rust/src/bin/fatcat-auth.rs @@ -13,7 +13,7 @@ extern crate env_logger; extern crate serde_json; extern crate uuid; -use clap::{App, Arg, SubCommand}; +use clap::{App, SubCommand}; use dotenv::dotenv; use std::env; @@ -90,13 +90,13 @@ fn run() -> Result<()> { .get_matches(); let db_conn = database_worker_pool()?.get().expect("database pool"); - let confectionary = fatcat::auth::AuthConfectionary::new(); + let confectionary = fatcat::auth::AuthConfectionary::new_dummy(); match m.subcommand() { ("list-editors", Some(_subm)) => { fatcat::auth::print_editors(&db_conn)?; }, ("create-editor", Some(subm)) => { - let editor = fatcat::auth::create_editor( + let editor = fatcat::api_helpers::create_editor( &db_conn, subm.value_of("username").unwrap().to_string(), subm.is_present("admin"), @@ -109,7 +109,7 @@ fn run() -> Result<()> { println!("{}", confectionary.create_token(&db_conn, editor_id, None)?); }, ("inspect-token", Some(subm)) => { - fatcat::auth::inspect_token(&db_conn, subm.value_of("token").unwrap())?; + confectionary.inspect_token(&db_conn, subm.value_of("token").unwrap())?; }, ("revoke-tokens", Some(subm)) => { let editor_id = FatCatId::from_str(subm.value_of("editor-id").unwrap())?; |