diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-28 14:52:38 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-28 15:45:10 -0800 |
commit | f9408344464285870409c2209a8edc8d25fd9bfa (patch) | |
tree | 386e2472c22e9c79f8a58e2f419c9fbaef00dd13 /rust/src/bin/fatcat-auth.rs | |
parent | fa1892834a4650bf2e85215a3270e309d3e9f1c9 (diff) | |
download | fatcat-f9408344464285870409c2209a8edc8d25fd9bfa.tar.gz fatcat-f9408344464285870409c2209a8edc8d25fd9bfa.zip |
start refactor of auth code
Pulls auth code (which requires the persistent state of a signing
keyring) into a struct.
Doesn't try verify macaroon in middleware, do it in individual wrappers.
Diffstat (limited to 'rust/src/bin/fatcat-auth.rs')
-rw-r--r-- | rust/src/bin/fatcat-auth.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rust/src/bin/fatcat-auth.rs b/rust/src/bin/fatcat-auth.rs index 9b4550d8..f11f7a67 100644 --- a/rust/src/bin/fatcat-auth.rs +++ b/rust/src/bin/fatcat-auth.rs @@ -90,6 +90,7 @@ fn run() -> Result<()> { .get_matches(); let db_conn = database_worker_pool()?.get().expect("database pool"); + let confectionary = fatcat::auth::AuthConfectionary::new(); match m.subcommand() { ("list-editors", Some(_subm)) => { fatcat::auth::print_editors(&db_conn)?; @@ -105,7 +106,7 @@ fn run() -> Result<()> { }, ("create-token", Some(subm)) => { let editor_id = FatCatId::from_str(subm.value_of("editor-id").unwrap())?; - println!("{}", fatcat::auth::create_token(&db_conn, editor_id, None)?); + println!("{}", confectionary.create_token(&db_conn, editor_id, None)?); }, ("inspect-token", Some(subm)) => { fatcat::auth::inspect_token(&db_conn, subm.value_of("token").unwrap())?; |