pub enum AppsyncIdentity {
Cognito(AppsyncIdentityCognito),
Iam(AppsyncIdentityIam),
Oidc(AppsyncIdentityOidc),
Lambda(AppsyncIdentityLambda),
ApiKey,
}
Expand description
Identity information for an AppSync request.
Represents the identity context of the authenticated user/client making the request to AWS AppSync. This enum corresponds directly to AppSync’s authorization types as defined in the AWS documentation.
Each variant maps to one of the five supported AWS AppSync authorization modes:
-
Cognito: Uses Amazon Cognito User Pools, providing group-based access control with JWT tokens containing encoded user information like groups and custom claims.
-
Iam: Uses AWS IAM roles and policies through AWS Signature Version 4 signing. Can be used either directly with IAM users/roles or through Cognito Identity Pools for federated access. Enables fine-grained access control through IAM policies.
-
Oidc: OpenID Connect authentication integrating with any OIDC-compliant provider.
-
Lambda: Custom authorization through an AWS Lambda function that evaluates each request.
-
ApiKey: Simple API key-based authentication using keys generated and managed by AppSync.
The variant is determined by the authorization configuration of your AppSync API and the authentication credentials provided in the request. Each variant contains structured information specific to that authentication mode, which can be used in resolvers for custom authorization logic.
More information can be found in the AWS documentation.
Variants§
Cognito(AppsyncIdentityCognito)
Amazon Cognito User Pools authentication
Iam(AppsyncIdentityIam)
AWS IAM authentication
Oidc(AppsyncIdentityOidc)
OpenID Connect authentication
Lambda(AppsyncIdentityLambda)
Lambda authorizer authentication
ApiKey
API Key authentication (represents null identity in JSON)
Trait Implementations§
Source§impl Debug for AppsyncIdentity
impl Debug for AppsyncIdentity
Source§impl<'de> Deserialize<'de> for AppsyncIdentity
impl<'de> Deserialize<'de> for AppsyncIdentity
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 AppsyncIdentity
impl RefUnwindSafe for AppsyncIdentity
impl Send for AppsyncIdentity
impl Sync for AppsyncIdentity
impl Unpin for AppsyncIdentity
impl UnwindSafe for AppsyncIdentity
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> 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