Erik Robertson
11/01/2021, 6:52 PMGarret Harp
11/01/2021, 7:03 PM$request.querystring.auth_token
see: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.identity-sourcesFrank
Erik Robertson
11/01/2021, 7:16 PMFrank
authorizationType
the same ie. ApiAuthorizationType.JWT
and use different authorizersFrank
const authorizerA = new HttpJwtAuthorizer(...);
const authorizerB = new HttpJwtAuthorizer(...);
new Api(this, "Api", {
defaultAuthorizationType: ApiAuthorizationType.JWT,
defaultAuthorizer: authorizerA,
routes: {
"GET /routeX": "src/routeX.main",
"GET /routeY": "src/routeY.main",
"GET /routeZ": {
function: "src/routeZ.main",
authorizer: authorizerB
},
},
});
Frank
Frank
Chad (cysense)
11/02/2021, 4:04 AMErik Robertson
11/02/2021, 12:05 PMThere is already a Construct with name 'UserPoolAuthorizer' in HttpApi [Api]
Here is my code excerpt :
const tokenInUrlAuthorizer = new HttpUserPoolAuthorizer({
userPool: userPool,
userPoolClient: userPoolClient,
identitySource: ['$request.querystring.atk'],
})
const defaultAuthorizer = new HttpUserPoolAuthorizer({
userPool: userPool,
userPoolClient: userPoolClient,
})
const api = new sst.Api(this, "Api", {
defaultAuthorizationType: sst.ApiAuthorizationType.JWT,
defaultAuthorizer: defaultAuthorizer,
routes: {
"GET /fetch_csv": { function: "src/fetch_csv.main", authorizer: tokenInUrlAuthorizer },
"GET /private": "src/private.main",
...
Frank
authorizerName
? UserPoolAuthorizer
is the default name.Erik Robertson
11/02/2021, 4:35 PM