pub struct GetSigningKeyRequest {
pub signing_key_kind: SigningKeyKind,
pub access_key: String,
pub session_token: Option<String>,
pub request_date: NaiveDate,
pub region: String,
pub service: String,
}
Expand description
A request for retrieving a signing key from an outside source.
Fields§
§signing_key_kind: SigningKeyKind
The type of signing key to retrieve.
access_key: String
The access key to use to retrieve the signing key.
session_token: Option<String>
An optional session token to use to retrieve the signing key.
request_date: NaiveDate
The date of the request.
region: String
The region of the service being accessed.
service: String
The service being accessed.
Trait Implementations§
Source§impl<F, Fut, E> Service<GetSigningKeyRequest> for GetSigningKeyFn<F>
Implementation of a Service
for GetSigningKeyFn
.
impl<F, Fut, E> Service<GetSigningKeyRequest> for GetSigningKeyFn<F>
Implementation of a Service
for GetSigningKeyFn
.
To send the request, use the call
method.
Source§fn call(&mut self, req: GetSigningKeyRequest) -> Self::Future
fn call(&mut self, req: GetSigningKeyRequest) -> Self::Future
Invoke the underlying function to retrieve a signing key.
§Example
use tower::Service;
async fn get_key(
kind: SigningKeyKind,
access_key: String,
session_token: Option<String>,
request_date: NaiveDate,
region: String,
service: String)
-> Result<(PrincipalActor, SigningKey), SignatureError> {
// Replace with your implementation for obtaining a key.
let actor = PrincipalActor::user(
"aws", "123456789012", "/", "user", "AIDAQXZEAEXAMPLEUSER").unwrap();
let key = SigningKey {
kind: SigningKeyKind::KSecret,
key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY".as_bytes().to_vec()
};
Ok((actor, key.try_derive(kind, &request_date, region, service)?))
}
let mut get_key_service = get_signing_key_fn(get_key);
let req = GetSigningKeyRequest {
signing_key_kind: SigningKeyKind::KSigning,
access_key: "AKIAIOSFODNN7EXAMPLE".to_string(),
session_token: None,
request_date: NaiveDate::from_ymd_opt(2021, 1, 1).unwrap(),
region: "us-east-1".to_string(),
service: "example".to_string(),
};
let (actor, key) = get_key_service.call(req).await.unwrap();
Source§type Response = (PrincipalActor, SigningKey)
type Response = (PrincipalActor, SigningKey)
Responses given by the service.
Auto Trait Implementations§
impl Freeze for GetSigningKeyRequest
impl RefUnwindSafe for GetSigningKeyRequest
impl Send for GetSigningKeyRequest
impl Sync for GetSigningKeyRequest
impl Unpin for GetSigningKeyRequest
impl UnwindSafe for GetSigningKeyRequest
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