class IdentitySource
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.APIGateway.IdentitySource |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#IdentitySource |
Java | software.amazon.awscdk.services.apigateway.IdentitySource |
Python | aws_cdk.aws_apigateway.IdentitySource |
TypeScript (source) | aws-cdk-lib » aws_apigateway » IdentitySource |
Represents an identity source.
The source can be specified either as a literal value (e.g: Auth) which
cannot be blank, or as an unresolved string token.
Example
declare const authFn: lambda.Function;
declare const books: apigateway.Resource;
const auth = new apigateway.RequestAuthorizer(this, 'booksAuthorizer', {
handler: authFn,
identitySources: [apigateway.IdentitySource.header('Authorization')]
});
books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
authorizer: auth
});
Initializer
new IdentitySource()
Methods
| Name | Description |
|---|---|
| static context(context) | Provides a properly formatted request context identity source. |
| static header(headerName) | Provides a properly formatted header identity source. |
| static query | Provides a properly formatted query string identity source. |
| static stage | Provides a properly formatted API Gateway stage variable identity source. |
static context(context)
public static context(context: string): string
Parameters
- context
string— the name of the context variable theIdentitySourcewill represent.
Returns
string
Provides a properly formatted request context identity source.
static header(headerName)
public static header(headerName: string): string
Parameters
- headerName
string— the name of the header theIdentitySourcewill represent.
Returns
string
Provides a properly formatted header identity source.
static queryString(queryString)
public static queryString(queryString: string): string
Parameters
- queryString
string— the name of the query string theIdentitySourcewill represent.
Returns
string
Provides a properly formatted query string identity source.
static stageVariable(stageVariable)
public static stageVariable(stageVariable: string): string
Parameters
- stageVariable
string— the name of the stage variable theIdentitySourcewill represent.
Returns
string
Provides a properly formatted API Gateway stage variable identity source.

.NET
Go
Java
Python
TypeScript (