Initial stabilization #1

Merged
dzu merged 10 commits from stabilize-v1 into main 2026-02-20 16:23:43 +01:00
Showing only changes of commit 9de30e2308 - Show all commits

move flexible Client input types

Artem Diachenko 2026-02-19 10:09:42 +00:00

View file

@ -7,7 +7,7 @@ use isahc::{
config::Configurable,
http::{Method, StatusCode, header},
};
use secrecy::{ExposeSecret, SecretString};
use secrecy::SecretString;
pub fn paths_parser(input: OsString) -> Result<Vec<PathBuf>, FromUtf8Error> {
let input = String::from_utf8(input.into_encoded_bytes())?;
@ -72,15 +72,15 @@ pub struct Client {
pub struct CacheId(u64);
impl Client {
pub fn new(actions_token: SecretString, base_url: String) -> Result<Self> {
pub fn new(actions_token: impl AsRef<str>, base_url: impl Into<String>) -> Result<Self> {
let http_client = HttpClientBuilder::new()
.authentication(Authentication::basic())
.credentials(Credentials::new("Bearer", actions_token.expose_secret()))
.credentials(Credentials::new("Bearer", actions_token.as_ref()))
.build()
.context("initializing the client")?;
Ok(Self {
http_client,
base_url,
base_url: base_url.into(),
})
}