Private
Public Access
1
0

daemon: Token store

This commit is contained in:
2025-04-27 14:01:19 -07:00
parent 84f782cc03
commit 49f8b81b9c
8 changed files with 51 additions and 26 deletions

View File

@@ -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 {