pub struct Session {Show 13 fields
pub id: String,
pub created_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub ttl_seconds: u64,
pub budget: Option<f64>,
pub policy: ScopedPolicy,
pub status: SessionStatus,
pub role_arn: String,
pub command: Vec<String>,
pub access_key_id: Option<String>,
pub provider: CloudProvider,
pub agent_id: Option<String>,
pub tags: HashMap<String, String>,
}Expand description
Represents an active agent credential session.
Fields§
§id: String§created_at: DateTime<Utc>§expires_at: DateTime<Utc>§ttl_seconds: u64§budget: Option<f64>§policy: ScopedPolicy§status: SessionStatus§role_arn: StringAWS: IAM role ARN. GCP: service account email. Azure: subscription ID or principal.
command: Vec<String>§access_key_id: Option<String>AWS access key for this session (populated after credential creation).
provider: CloudProviderCloud provider (defaults to AWS for backwards compat).
agent_id: Option<String>Agent identity (from AUDEX_AGENT_ID env var) — tracks which AI agent/model issued the request.
User-supplied key:value tags for audit filtering and STS session tags.
Implementations§
Source§impl Session
impl Session
pub fn new( ttl: Duration, budget: Option<f64>, policy: ScopedPolicy, role_arn: String, command: Vec<String>, ) -> Self
pub fn new_gcp( ttl: Duration, budget: Option<f64>, policy: ScopedPolicy, service_account: String, command: Vec<String>, ) -> Self
pub fn new_azure( ttl: Duration, budget: Option<f64>, policy: ScopedPolicy, subscription_id: String, command: Vec<String>, ) -> Self
pub fn is_expired(&self) -> bool
pub fn remaining_seconds(&self) -> i64
pub fn complete(&mut self)
pub fn expire(&mut self)
pub fn revoke(&mut self)
pub fn fail(&mut self)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
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 Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<D> DeserializeWith<JsonFormat> for Dwhere
D: DeserializeOwned,
impl<D> DeserializeWith<JsonFormat> for Dwhere
D: DeserializeOwned,
Source§fn deserialize_with(body: ResponseBody) -> Result<D, Error>
fn deserialize_with(body: ResponseBody) -> Result<D, Error>
Deserialize the response body using the specified format. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.