gql.transport.appsync_auth
- class gql.transport.appsync_auth.AppSyncAuthentication
Bases:
ABCAWS authentication abstract base class
All AWS authentication class should have a
get_headersmethod which defines the headers used in the authentication process.
- class gql.transport.appsync_auth.AppSyncApiKeyAuthentication(host: str, api_key: str)
Bases:
AppSyncAuthenticationAWS authentication class using an API key
- class gql.transport.appsync_auth.AppSyncJWTAuthentication(host: str, jwt: str)
Bases:
AppSyncAuthenticationAWS authentication class using a JWT access token.
- It can be used either for:
Amazon Cognito user pools
OpenID Connect (OIDC)
- class gql.transport.appsync_auth.AppSyncIAMAuthentication(host: str, region_name: str | None = None, signer: botocore.auth.BaseSigner | None = None, request_creator: Callable[[Dict[str, Any]], botocore.awsrequest.AWSRequest] | None = None, credentials: botocore.credentials.Credentials | None = None, session: botocore.session.Session | None = None)
Bases:
AppSyncAuthenticationAWS authentication class using IAM.
Note
There is no need for you to use this class directly, you could instead intantiate
gql.transport.appsync_websockets.AppSyncWebsocketsTransportwithout an auth argument.During initialization, this class will use botocore to attempt to find your IAM credentials, either from environment variables or from your AWS credentials file.
- __init__(host: str, region_name: str | None = None, signer: botocore.auth.BaseSigner | None = None, request_creator: Callable[[Dict[str, Any]], botocore.awsrequest.AWSRequest] | None = None, credentials: botocore.credentials.Credentials | None = None, session: botocore.session.Session | None = None) None
Initialize itself, saving the found credentials used to sign the headers later.
if no credentials are found, then a NoCredentialsError is raised.