Last active
November 2, 2022 03:34
-
-
Save cal0610/4448d14eb4a5a9139c26d32c64d2c3d9 to your computer and use it in GitHub Desktop.
lambda authoriser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const medium_username = ssm.StringParameter.fromStringParameterName(this, 'medium_username', 'medium_username'); | |
const medium_password = ssm.StringParameter.fromStringParameterName(this, 'medium_password', 'medium_password'); | |
const authorizerFn = new NodejsFunction(this, 'BasicAuthAuthorizer', { | |
entry: join(__dirname, '..', 'lambda', '/authorizer.ts'), | |
handler: 'authorizer', | |
environment: { | |
medium_username: medium_username.stringValue, | |
medium_password: medium_password.stringValue, | |
}, | |
}); | |
const authorizer = new TokenAuthorizer(this, 'token-authorizer', { | |
handler: authorizerFn, | |
identitySource: 'method.request.header.Authorization', | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment