pub enum KmsCaller<'a> {
OnBehalfOf {
service_principal: &'a str,
caller_arn: Option<&'a str>,
},
Service {
service_principal: &'a str,
source_arn: &'a str,
source_account: &'a str,
via_service: Option<&'a str>,
},
}Expand description
Who a cross-service KMS call is made as, which decides what the key policy sees.
AWS services use KMS in one of two ways, and key policies are written for
each: most (S3 SSE-KMS, SQS, SNS, DynamoDB, Secrets Manager, SSM) call KMS
on behalf of the caller of their own API, with the caller’s identity,
and KMS adds kms:ViaService = <service>.<region>.amazonaws.com (the
AWS-managed aws/<service> keys only allow that); a few (SES writing
received mail to S3, Lambda for durable executions) call KMS as their
service principal, which a key policy must name in a "Service"
principal.
Variants§
OnBehalfOf
The service identified by service_principal (s3.amazonaws.com)
acting for a caller of its API in the request’s account.
Fields
Service
The service principal itself (ses.us-east-1.amazonaws.com) acting
for its resource source_arn owned by source_account (the
aws:SourceArn / aws:SourceAccount of the request).
Implementations§
Source§impl<'a> KmsCaller<'a>
impl<'a> KmsCaller<'a>
Sourcepub fn via(service_principal: &'a str) -> Self
pub fn via(service_principal: &'a str) -> Self
A service calling KMS on behalf of the account, with no known caller
identity (see KmsCaller::OnBehalfOf).
Sourcepub fn via_for(service_principal: &'a str, caller_arn: Option<&'a str>) -> Self
pub fn via_for(service_principal: &'a str, caller_arn: Option<&'a str>) -> Self
A service calling KMS on behalf of the caller caller_arn of its API.
Sourcepub fn service_principal(&self) -> &'a str
pub fn service_principal(&self) -> &'a str
The service principal the call is recorded under.
Trait Implementations§
impl<'a> Copy for KmsCaller<'a>
impl<'a> Eq for KmsCaller<'a>
impl<'a> StructuralPartialEq for KmsCaller<'a>
Auto Trait Implementations§
impl<'a> Forget for KmsCaller<'a>
impl<'a> Freeze for KmsCaller<'a>
impl<'a> Move for KmsCaller<'a>
impl<'a> RefUnwindSafe for KmsCaller<'a>
impl<'a> Send for KmsCaller<'a>
impl<'a> Sync for KmsCaller<'a>
impl<'a> Unpin for KmsCaller<'a>
impl<'a> UnsafeUnpin for KmsCaller<'a>
impl<'a> UnwindSafe for KmsCaller<'a>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.