-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add AppSyncIdentity #173
add AppSyncIdentity #173
Conversation
Codecov Report
@@ Coverage Diff @@
## master #173 +/- ##
=======================================
Coverage 77.12% 77.12%
=======================================
Files 18 18
Lines 634 634
=======================================
Hits 489 489
Misses 104 104
Partials 41 41 Continue to review full report at Codecov.
|
events/appsync.go
Outdated
@@ -9,6 +9,20 @@ type AppSyncResolverTemplate struct { | |||
Payload json.RawMessage `json:"payload"` | |||
} | |||
|
|||
// AppSyncIdentity contains information about the caller. The shape of this section depends on the authorization type of your AWS AppSync API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that there'd need to be 2 types added, rather than the union of both shapes. https://docs.aws.amazon.com/appsync/latest/devguide/resolver-context-reference.html
AppSyncIAMIdentity
AppSyncCognitoIdentity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unmarshalling / marshalling $context.identity
into the single type works either way, but I'll separate out the type if that's what's desired.
hmmm also noticing now the test are off...will ping you when resolved. |
* fix tests to check marshalling / unmarshalling of identity json
@bmoffatt i've updated everything:
u mind having a look? 😃 |
Arn -> ARN Id -> ID Ip -> IP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Issue #, if available:
Description of changes:
Adds new
AppSyncIdentity
struct which represents the.identity
field of context. Other context fields are left out because they are all custom structures that depend on user implementation.One thing to note is that
AppSyncIdentity.Claims
is of typemap[string]interface{}
which sucks, but Claims values can be eitherNumber
orString
json types and there may be custom claims added by the user...By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.