pub struct ScopedPolicy {
pub actions: Vec<ActionPattern>,
pub resources: Vec<String>,
}Expand description
A scoped IAM policy built from user-specified allowed actions.
Fields§
§actions: Vec<ActionPattern>§resources: Vec<String>Implementations§
Source§impl ScopedPolicy
impl ScopedPolicy
Sourcepub fn from_allow_str(allow: &str) -> Result<Self>
pub fn from_allow_str(allow: &str) -> Result<Self>
Parse a comma-separated allow string like “s3:GetObject,lambda:Update*”. Optionally accepts resource ARNs to restrict beyond just actions.
Sourcepub fn from_allow_str_with_resources(
allow: &str,
resources: Option<&str>,
) -> Result<Self>
pub fn from_allow_str_with_resources( allow: &str, resources: Option<&str>, ) -> Result<Self>
Parse allow string with optional resource ARN restrictions.
Sourcepub fn from_gcp_allow_str(allow: &str) -> Result<Self>
pub fn from_gcp_allow_str(allow: &str) -> Result<Self>
Parse a comma-separated GCP permissions string like “storage.objects.get,compute.instances.list”.
Sourcepub fn from_azure_allow_str(allow: &str) -> Result<Self>
pub fn from_azure_allow_str(allow: &str) -> Result<Self>
Parse a comma-separated Azure permissions string like “Microsoft.Storage/storageAccounts/read”.
Sourcepub fn to_iam_policy_json(&self) -> Result<String>
pub fn to_iam_policy_json(&self) -> Result<String>
Generate the AWS IAM policy JSON document for STS inline policy.
Sourcepub fn to_iam_policy_json_with_tag_lock(&self, tag_key: &str) -> Result<String>
pub fn to_iam_policy_json_with_tag_lock(&self, tag_key: &str) -> Result<String>
Generate the AWS IAM policy JSON with a Deny statement that blocks
the caller from removing or overwriting the given tag key. Used by
--tag-session to keep agents from stripping the tryaudex-session
marker mid-session and escaping cleanup.
Sourcepub fn to_iam_policy_json_with_network_and_tag_lock(
&self,
network: Option<&NetworkPolicy>,
tag_lock_key: Option<&str>,
) -> Result<String>
pub fn to_iam_policy_json_with_network_and_tag_lock( &self, network: Option<&NetworkPolicy>, tag_lock_key: Option<&str>, ) -> Result<String>
Full policy JSON with both network conditions and tag-lock deny.
Sourcepub fn to_iam_policy_json_with_network(
&self,
network: Option<&NetworkPolicy>,
) -> Result<String>
pub fn to_iam_policy_json_with_network( &self, network: Option<&NetworkPolicy>, ) -> Result<String>
Generate the AWS IAM policy JSON with optional network conditions.
Sourcepub fn enforce_deny_list(&self, deny: &[String]) -> Result<()>
pub fn enforce_deny_list(&self, deny: &[String]) -> Result<()>
Check all actions against a deny list. Returns error if any action is denied.
Trait Implementations§
Source§impl Clone for ScopedPolicy
impl Clone for ScopedPolicy
Source§fn clone(&self) -> ScopedPolicy
fn clone(&self) -> ScopedPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScopedPolicy
impl Debug for ScopedPolicy
Source§impl<'de> Deserialize<'de> for ScopedPolicy
impl<'de> Deserialize<'de> for ScopedPolicy
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>,
Auto Trait Implementations§
impl Freeze for ScopedPolicy
impl RefUnwindSafe for ScopedPolicy
impl Send for ScopedPolicy
impl Sync for ScopedPolicy
impl Unpin for ScopedPolicy
impl UnsafeUnpin for ScopedPolicy
impl UnwindSafe for ScopedPolicy
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
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>
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>
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>
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 more