mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-09-01 17:19:24 +00:00
ci: Added CI/CD and release pipelines (#45)
This commit is contained in:
+8
-18
@@ -101,15 +101,13 @@ mod platform {
|
||||
let ss = SecretService::connect(EncryptionType::Dh)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
SecretError::KeychainError(format!(
|
||||
"Failed to connect to secret service: {}",
|
||||
e
|
||||
))
|
||||
SecretError::KeychainError(format!("Failed to connect to secret service: {}", e))
|
||||
})?;
|
||||
|
||||
let collection = ss.get_default_collection().await.map_err(|e| {
|
||||
SecretError::KeychainError(format!("Failed to get collection: {}", e))
|
||||
})?;
|
||||
let collection = ss
|
||||
.get_default_collection()
|
||||
.await
|
||||
.map_err(|e| SecretError::KeychainError(format!("Failed to get collection: {}", e)))?;
|
||||
|
||||
// Unlock if needed
|
||||
if collection.is_locked().await.unwrap_or(true) {
|
||||
@@ -132,9 +130,7 @@ mod platform {
|
||||
"text/plain",
|
||||
)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
SecretError::KeychainError(format!("Failed to create secret: {}", e))
|
||||
})?;
|
||||
.map_err(|e| SecretError::KeychainError(format!("Failed to create secret: {}", e)))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -144,10 +140,7 @@ mod platform {
|
||||
let ss = SecretService::connect(EncryptionType::Dh)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
SecretError::KeychainError(format!(
|
||||
"Failed to connect to secret service: {}",
|
||||
e
|
||||
))
|
||||
SecretError::KeychainError(format!("Failed to connect to secret service: {}", e))
|
||||
})?;
|
||||
|
||||
let items = ss
|
||||
@@ -188,10 +181,7 @@ mod platform {
|
||||
let ss = SecretService::connect(EncryptionType::Dh)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
SecretError::KeychainError(format!(
|
||||
"Failed to connect to secret service: {}",
|
||||
e
|
||||
))
|
||||
SecretError::KeychainError(format!("Failed to connect to secret service: {}", e))
|
||||
})?;
|
||||
|
||||
let items = ss
|
||||
|
||||
@@ -192,9 +192,10 @@ impl CreateSecretParams {
|
||||
}
|
||||
|
||||
/// Where a credential should be injected in an HTTP request.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
pub enum CredentialLocation {
|
||||
/// Inject as Authorization header (e.g., "Bearer {secret}")
|
||||
#[default]
|
||||
AuthorizationBearer,
|
||||
/// Inject as Authorization header with Basic auth
|
||||
AuthorizationBasic { username: String },
|
||||
@@ -209,12 +210,6 @@ pub enum CredentialLocation {
|
||||
UrlPath { placeholder: String },
|
||||
}
|
||||
|
||||
impl Default for CredentialLocation {
|
||||
fn default() -> Self {
|
||||
Self::AuthorizationBearer
|
||||
}
|
||||
}
|
||||
|
||||
/// Mapping from a secret name to where it should be injected.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct CredentialMapping {
|
||||
|
||||
Reference in New Issue
Block a user