Skip to content

Commit

Permalink
test: fix failing tests and refactor expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleadams committed Apr 15, 2022
1 parent 0e91a17 commit c287be9
Show file tree
Hide file tree
Showing 11 changed files with 203 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ $util.unauthorized()
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.source.owner, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#if( $ownerEntity0 == $ownerClaim0 )
#set( $isAuthorized = true )
#end
Expand Down Expand Up @@ -63,11 +63,14 @@ $util.unauthorized()
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.owner, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#set( $ownerClaimsList0 = [] )
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\")))
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\"))))
#set( $ownerAllowedFields0 = [\\"id\\",\\"name\\",\\"description\\",\\"secretValue\\"] )
#set( $isAuthorizedOnAllFields0 = true )
#if( $ownerClaim0 == $ownerEntity0 )
#if( $ownerClaim0 == $ownerEntity0 || $ownerClaimsList0.contains($ownerEntity0) )
#if( $isAuthorizedOnAllFields0 )
#set( $isAuthorized = true )
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $util.unauthorized()
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.source.owner, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#if( $ownerEntity0 == $ownerClaim0 )
#set( $isAuthorized = true )
#end
Expand Down Expand Up @@ -51,8 +51,8 @@ exports[`generates field resolver for other provider rules even if private remov
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.source.owner, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#if( $ownerEntity0 == $ownerClaim0 )
#set( $isAuthorized = true )
#end
Expand Down Expand Up @@ -144,8 +144,8 @@ exports[`subscription disabled and userPools configured with non-nullable (requi
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.source.owner, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#if( $ownerEntity0 == $ownerClaim0 )
#set( $isAuthorized = true )
#end
Expand Down Expand Up @@ -187,8 +187,8 @@ exports[`subscription disabled and userPools configured with nullable fields top
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.source.owner, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#if( $ownerEntity0 == $ownerClaim0 )
#set( $isAuthorized = true )
#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.editors, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#set( $ownerClaimsList0 = [] )
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\")))
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\"))))
#set( $ownerAllowedFields0 = [\\"id\\",\\"title\\",\\"editors\\",\\"createdAt\\",\\"updatedAt\\"] )
#set( $isAuthorizedOnAllFields0 = true )
#foreach( $allowedOwner in $ownerEntity0 )
#if( $allowedOwner == $ownerClaim0 )
#if( $allowedOwner == $ownerClaim0 || $ownerClaimsList0.contains($ownerEntity0) )
#if( $isAuthorizedOnAllFields0 )
#set( $isAuthorized = true )
#break
Expand Down Expand Up @@ -92,8 +95,8 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#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\\": $ownerClaim0 }}))
#end
Expand Down Expand Up @@ -126,8 +129,8 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#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\\": $ownerClaim0 }}))
#end
Expand Down Expand Up @@ -157,8 +160,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 @@ -169,10 +172,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 @@ -183,7 +186,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 @@ -229,11 +232,14 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.owner, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#set( $ownerClaimsList0 = [] )
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\")))
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\"))))
#set( $ownerAllowedFields0 = [\\"id\\",\\"title\\",\\"createdAt\\",\\"updatedAt\\"] )
#set( $isAuthorizedOnAllFields0 = true )
#if( $ownerClaim0 == $ownerEntity0 )
#if( $ownerClaim0 == $ownerEntity0 || $ownerClaimsList0.contains($ownerEntity0) )
#if( $isAuthorizedOnAllFields0 )
#set( $isAuthorized = true )
#else
Expand Down Expand Up @@ -308,8 +314,8 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#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\\": $ownerClaim0 }}))
#end
Expand Down Expand Up @@ -342,8 +348,8 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#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\\": $ownerClaim0 }}))
#end
Expand Down Expand Up @@ -377,10 +383,12 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.editors, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaimsList0 = [] )
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\"))))
#set( $ownerAllowedFields0 = [\\"id\\",\\"title\\",\\"editors\\",\\"createdAt\\",\\"updatedAt\\"] )
#set( $isAuthorizedOnAllFields0 = true )
#foreach( $allowedOwner in $ownerEntity0 )
#if( $allowedOwner == $ownerClaim0 )
#if( $allowedOwner == $ownerClaim0 || $ownerClaimsList0.contains($ownerEntity0) )
#if( $isAuthorizedOnAllFields0 )
#set( $isAuthorized = true )
#break
Expand Down Expand Up @@ -502,8 +510,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 @@ -514,10 +522,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 @@ -528,7 +536,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 @@ -574,11 +582,14 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.owner, null) )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" )
#set( $ownerClaimsList0 = [] )
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\")))
$util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\"))))
#set( $ownerAllowedFields0 = [\\"id\\",\\"title\\",\\"createdAt\\",\\"updatedAt\\"] )
#set( $isAuthorizedOnAllFields0 = true )
#if( $ownerClaim0 == $ownerEntity0 )
#if( $ownerClaim0 == $ownerEntity0 || $ownerClaimsList0.contains($ownerEntity0) )
#if( $isAuthorizedOnAllFields0 )
#set( $isAuthorized = true )
#else
Expand Down Expand Up @@ -653,8 +664,8 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#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\\": $ownerClaim0 }}))
#end
Expand Down Expand Up @@ -687,8 +698,8 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#if( !$isAuthorized )
#set( $authFilter = [] )
#set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") )
#set( $currentClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) )
#set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim0\\" )
#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\\": $ownerClaim0 }}))
#end
Expand Down
Loading

0 comments on commit c287be9

Please sign in to comment.