Skip to content

Commit

Permalink
fix: update snapshots for owner auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleadams committed Apr 28, 2022
1 parent 2c412ca commit 712d5fa
Showing 1 changed file with 76 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,19 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( $util.authType() == \\"User Pool Authorization\\" )
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $role0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub::username\\"), \\"___xamznone____\\") )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0::$currentClaim1\\" )
#if( $role0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"editors\\": { \\"contains\\": $role0 }}))
$util.qr($authFilter.add({\\"editors\\": { \\"contains\\": $ownerClaim0 }}))
#end
#set( $role0_0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( $role0_0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"editors\\": { \\"contains\\": $role0_0 }}))
#end
#set( $role0_1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#if( $role0_1 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"editors\\": { \\"contains\\": $role0_1 }}))
#end
#if( !$authFilter.isEmpty() )
$util.qr($ctx.stash.put(\\"authFilter\\", { \\"or\\": $authFilter }))
Expand All @@ -118,9 +128,19 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( $util.authType() == \\"User Pool Authorization\\" )
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $role0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub::username\\"), \\"___xamznone____\\") )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0::$currentClaim1\\" )
#if( $role0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"editors\\": { \\"contains\\": $role0 }}))
$util.qr($authFilter.add({\\"editors\\": { \\"contains\\": $ownerClaim0 }}))
#end
#set( $role0_0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( $role0_0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"editors\\": { \\"contains\\": $role0_0 }}))
#end
#set( $role0_1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#if( $role0_1 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"editors\\": { \\"contains\\": $role0_1 }}))
#end
#if( !$authFilter.isEmpty() )
$util.qr($ctx.stash.put(\\"authFilter\\", { \\"or\\": $authFilter }))
Expand Down Expand Up @@ -267,8 +287,8 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#set( $isAuthorized = false )
#set( $primaryFieldMap = {} )
#if( $util.authType() == \\"User Pool Authorization\\" )
#set( $parentClaim = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( !$util.isNull($ctx.args.parent) )
#set( $parentClaim = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( $util.isString($ctx.args.parent) )
#set( $parentCondition = ($parentClaim == $ctx.args.parent) )
#else
Expand All @@ -279,10 +299,10 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
$util.qr($ctx.stash.put(\\"authFilter\\", null))
#end
#else
$util.qr($primaryFieldMap.put(\\"parent\\", $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\")))
$util.qr($primaryFieldMap.put(\\"parent\\", $parentClaim))
#end
#set( $childClaim = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( !$util.isNull($ctx.args.child) )
#set( $childClaim = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( $util.isString($ctx.args.child) )
#set( $childCondition = ($childClaim == $ctx.args.child) )
#else
Expand All @@ -293,7 +313,7 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
$util.qr($ctx.stash.put(\\"authFilter\\", null))
#end
#else
$util.qr($primaryFieldMap.put(\\"child\\", $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\")))
$util.qr($primaryFieldMap.put(\\"child\\", $childClaim))
#end
#if( !$isAuthorized && !$primaryFieldMap.isEmpty() )
#if( $util.isNull($ctx.args.parent) )
Expand Down Expand Up @@ -420,9 +440,19 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( $util.authType() == \\"User Pool Authorization\\" )
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $role0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub::username\\"), \\"___xamznone____\\") )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0::$currentClaim1\\" )
#if( $role0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0 }}))
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $ownerClaim0 }}))
#end
#set( $role0_0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( $role0_0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0_0 }}))
#end
#set( $role0_1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#if( $role0_1 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0_1 }}))
#end
#if( !$authFilter.isEmpty() )
$util.qr($ctx.stash.put(\\"authFilter\\", { \\"or\\": $authFilter }))
Expand All @@ -444,9 +474,19 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( $util.authType() == \\"User Pool Authorization\\" )
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $role0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub::username\\"), \\"___xamznone____\\") )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0::$currentClaim1\\" )
#if( $role0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0 }}))
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $ownerClaim0 }}))
#end
#set( $role0_0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( $role0_0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0_0 }}))
#end
#set( $role0_1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#if( $role0_1 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0_1 }}))
#end
#if( !$authFilter.isEmpty() )
$util.qr($ctx.stash.put(\\"authFilter\\", { \\"or\\": $authFilter }))
Expand Down Expand Up @@ -749,9 +789,19 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( $util.authType() == \\"User Pool Authorization\\" )
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $role0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub::username\\"), \\"___xamznone____\\") )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0::$currentClaim1\\" )
#if( $role0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0 }}))
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $ownerClaim0 }}))
#end
#set( $role0_0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( $role0_0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0_0 }}))
#end
#set( $role0_1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#if( $role0_1 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0_1 }}))
#end
#if( !$authFilter.isEmpty() )
$util.qr($ctx.stash.put(\\"authFilter\\", { \\"or\\": $authFilter }))
Expand All @@ -773,9 +823,19 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( $util.authType() == \\"User Pool Authorization\\" )
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $role0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub::username\\"), \\"___xamznone____\\") )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0::$currentClaim1\\" )
#if( $role0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0 }}))
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $ownerClaim0 }}))
#end
#set( $role0_0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#if( $role0_0 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0_0 }}))
#end
#set( $role0_1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#if( $role0_1 != \\"___xamznone____\\" )
$util.qr($authFilter.add({\\"owner\\": { \\"eq\\": $role0_1 }}))
#end
#if( !$authFilter.isEmpty() )
$util.qr($ctx.stash.put(\\"authFilter\\", { \\"or\\": $authFilter }))
Expand Down

0 comments on commit 712d5fa

Please sign in to comment.