pub struct Secret {
pub id: SecretId,
pub name: String,
pub description: Option<String>,
pub encrypted_value: Vec<u8>,
pub encryption: EncryptionMetadata,
pub tags: Vec<String>,
pub owner_id: Uuid,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub last_accessed_at: Option<DateTime<Utc>>,
pub expires_at: Option<DateTime<Utc>>,
pub access_control: AccessControl,
}Expand description
Secret metadata and encrypted value
Fields§
§id: SecretIdUnique secret identifier
name: StringSecret name (must be unique per user/workspace)
description: Option<String>Optional description
encrypted_value: Vec<u8>Encrypted secret value
encryption: EncryptionMetadataEncryption metadata
Tags for categorization
owner_id: UuidUser or workspace ID that owns this secret
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last updated timestamp
last_accessed_at: Option<DateTime<Utc>>Last accessed timestamp
expires_at: Option<DateTime<Utc>>Expiration date (optional)
access_control: AccessControlAccess control rules
Implementations§
Source§impl Secret
impl Secret
Sourcepub fn new(
name: String,
encrypted_value: Vec<u8>,
encryption: EncryptionMetadata,
owner_id: Uuid,
) -> Self
pub fn new( name: String, encrypted_value: Vec<u8>, encryption: EncryptionMetadata, owner_id: Uuid, ) -> Self
Create a new secret (value must be encrypted before)
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if secret is expired
Sourcepub fn can_access_workflow(&self, workflow_id: &Uuid) -> bool
pub fn can_access_workflow(&self, workflow_id: &Uuid) -> bool
Check if workflow has access
Sourcepub fn can_access_user(&self, user_id: &Uuid) -> bool
pub fn can_access_user(&self, user_id: &Uuid) -> bool
Check if user has access
Sourcepub fn mark_accessed(&mut self)
pub fn mark_accessed(&mut self)
Update last accessed timestamp
Sourcepub fn to_safe_view(&self) -> SecretView
pub fn to_safe_view(&self) -> SecretView
Create a safe view without sensitive data
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Secret
impl<'de> Deserialize<'de> for Secret
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnwindSafe for Secret
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more