daemon: Token store
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
use kordophone::APIInterface;
|
||||
use kordophone::api::http_client::HTTPAPIClient;
|
||||
use kordophone::api::http_client::Credentials;
|
||||
use kordophone::api::InMemoryTokenManagement;
|
||||
use kordophone::api::InMemoryTokenStore;
|
||||
|
||||
use dotenv;
|
||||
use anyhow::Result;
|
||||
use clap::Subcommand;
|
||||
use crate::printers::{ConversationPrinter, MessagePrinter};
|
||||
|
||||
pub fn make_api_client_from_env() -> HTTPAPIClient {
|
||||
pub fn make_api_client_from_env() -> HTTPAPIClient<InMemoryTokenStore> {
|
||||
dotenv::dotenv().ok();
|
||||
|
||||
// read from env
|
||||
@@ -23,7 +23,7 @@ pub fn make_api_client_from_env() -> HTTPAPIClient {
|
||||
.expect("KORDOPHONE_PASSWORD must be set"),
|
||||
};
|
||||
|
||||
HTTPAPIClient::new(base_url.parse().unwrap(), credentials.into())
|
||||
HTTPAPIClient::new(base_url.parse().unwrap(), credentials.into(), InMemoryTokenStore::new())
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
@@ -52,7 +52,7 @@ impl Commands {
|
||||
}
|
||||
|
||||
struct ClientCli {
|
||||
api: HTTPAPIClient,
|
||||
api: HTTPAPIClient<InMemoryTokenStore>,
|
||||
}
|
||||
|
||||
impl ClientCli {
|
||||
|
||||
Reference in New Issue
Block a user