This file contains hidden or 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
exports.handler = async (event) => { | |
console.log('-- event', JSON.stringify(event)) | |
if (!event.request.session || event.request.session.length === 0) { | |
// If we don't have a session or it is empty then send a CUSTOM_CHALLENGE | |
event.response.challengeName = "CUSTOM_CHALLENGE"; | |
event.response.failAuthentication = false; | |
event.response.issueTokens = false; | |
} else if (event.request.session.length === 1 && event.request.session[0].challengeResult === true) { | |
// If we passed the CUSTOM_CHALLENGE then issue token | |
event.response.failAuthentication = false; |
This file contains hidden or 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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Cognito | |
Parameters: | |
AppName: | |
Type: String | |
Description: App name | |
DeploymentBucket: | |
Type: String |
This file contains hidden or 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
## [Start] Determine request authentication mode ** | |
#if( $util.isNullOrEmpty($authMode) && !$util.isNull($ctx.identity) && !$util.isNull($ctx.identity.sub) && !$util.isNull($ctx.identity.issuer) && !$util.isNull($ctx.identity.username) && !$util.isNull($ctx.identity.claims) && !$util.isNull($ctx.identity.sourceIp) && !$util.isNull($ctx.identity.defaultAuthStrategy) ) | |
#set( $authMode = "userPools" ) | |
#end | |
## [End] Determine request authentication mode ** | |
## [Start] Check authMode and execute owner/group checks ** | |
#if( $authMode == "userPools" ) | |
## [Start] Static Group Authorization Checks ** | |
#set($isStaticGroupAuthorized = $util.defaultIfNull( | |
$isStaticGroupAuthorized, false)) |
This file contains hidden or 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
{ | |
"version": "2017-02-28", | |
"operation": "GetItem", | |
"key": #if( $modelObjectKey ) $util.toJson($modelObjectKey) #else { | |
"id": $util.dynamodb.toDynamoDBJson($ctx.args.id) | |
} #end | |
} |
This file contains hidden or 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
#set( $limit = $util.defaultIfNull($context.args.limit, 10) ) | |
#set( $ListRequest = { | |
"version": "2017-02-28", | |
"limit": $limit | |
} ) | |
#if( $context.args.nextToken ) | |
#set( $ListRequest.nextToken = "$context.args.nextToken" ) | |
#end | |
#if( $context.args.filter ) | |
#set( $ListRequest.filter = $util.parseJson("$util.transform.toDynamoDBFilterExpression($ctx.args.filter)") ) |
This file contains hidden or 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
## [Start] Determine request authentication mode ** | |
#if( $util.isNullOrEmpty($authMode) && !$util.isNull($ctx.identity) && !$util.isNull($ctx.identity.sub) && !$util.isNull($ctx.identity.issuer) && !$util.isNull($ctx.identity.username) && !$util.isNull($ctx.identity.claims) && !$util.isNull($ctx.identity.sourceIp) && !$util.isNull($ctx.identity.defaultAuthStrategy) ) | |
#set( $authMode = "userPools" ) | |
#end | |
## [End] Determine request authentication mode ** | |
## [Start] Check authMode and execute owner/group checks ** | |
#if( $authMode == "userPools" ) | |
## [Start] Static Group Authorization Checks ** | |
#set($isStaticGroupAuthorized = $util.defaultIfNull( | |
$isStaticGroupAuthorized, false)) |
This file contains hidden or 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
## [Start] Determine request authentication mode ** | |
#if( $util.isNullOrEmpty($authMode) && !$util.isNull($ctx.identity) && !$util.isNull($ctx.identity.sub) && !$util.isNull($ctx.identity.issuer) && !$util.isNull($ctx.identity.username) && !$util.isNull($ctx.identity.claims) && !$util.isNull($ctx.identity.sourceIp) && !$util.isNull($ctx.identity.defaultAuthStrategy) ) | |
#set( $authMode = "userPools" ) | |
#end | |
## [End] Determine request authentication mode ** | |
## [Start] Check authMode and execute owner/group checks ** | |
#if( $authMode == "userPools" ) | |
## [Start] Static Group Authorization Checks ** | |
#set($isStaticGroupAuthorized = $util.defaultIfNull( | |
$isStaticGroupAuthorized, false)) |
This file contains hidden or 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
# Your keymap | |
# | |
# Atom keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# |
This file contains hidden or 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
"*": | |
"autocomplete-plus": | |
strictMatching: true | |
core: | |
disabledPackages: [ | |
"linter" | |
] | |
telemetryConsent: "no" | |
themes: [ | |
"atom-light-ui" |
This file contains hidden or 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
# Your keymap | |
# | |
# Atom keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# |