-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphql-auth-transformer): @auth allow more granular access righ…
…ts for read (#23)
- Loading branch information
Showing
26 changed files
with
1,245 additions
and
298 deletions.
There are no files selected for viewing
217 changes: 217 additions & 0 deletions
217
...amplify-graphql-auth-transformer/src/__tests__/__snapshots__/auth-operations.test.ts.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`read get list auth operations 1`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#set( $primaryFieldMap = {} ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#end | ||
#if( !$isAuthorized && $util.isNull($ctx.stash.authFilter) ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 2`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#set( $primaryFieldMap = {} ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#set( $isAuthorized = true ) | ||
#end | ||
#if( !$isAuthorized && $util.isNull($ctx.stash.authFilter) ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 3`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 4`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 5`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 6`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#set( $primaryFieldMap = {} ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#set( $isAuthorized = true ) | ||
#end | ||
#if( !$isAuthorized && $util.isNull($ctx.stash.authFilter) ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 7`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#set( $primaryFieldMap = {} ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#end | ||
#if( !$isAuthorized && $util.isNull($ctx.stash.authFilter) ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 8`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 9`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 10`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 11`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#set( $primaryFieldMap = {} ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#set( $isAuthorized = true ) | ||
#end | ||
#if( !$isAuthorized && $util.isNull($ctx.stash.authFilter) ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 12`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#set( $primaryFieldMap = {} ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#set( $isAuthorized = true ) | ||
#end | ||
#if( !$isAuthorized && $util.isNull($ctx.stash.authFilter) ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 13`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#set( $isAuthorized = true ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 14`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#set( $isAuthorized = true ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; | ||
|
||
exports[`read get list auth operations 15`] = ` | ||
"## [Start] Authorization Steps. ** | ||
$util.qr($ctx.stash.put(\\"hasAuth\\", true)) | ||
#set( $isAuthorized = false ) | ||
#if( $util.authType() == \\"API Key Authorization\\" ) | ||
#set( $isAuthorized = true ) | ||
#end | ||
#if( !$isAuthorized ) | ||
$util.unauthorized() | ||
#end | ||
$util.toJson({\\"version\\":\\"2018-05-29\\",\\"payload\\":{}}) | ||
## [End] Authorization Steps. **" | ||
`; |
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
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
Oops, something went wrong.