Repository navigation
Conversation
…dentity to AppSyncIdentityLambda
…out resolverContext
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
|
Contributor
|
Thanks @ibrhmyi, the code is fine, but @Goldloli asked for this issue a minute before you opened the PR, and we go with whoever claimed it first so people don't duplicate work. I'm closing this one. There are other |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #8718
With AppSync
AWS_LAMBDAauthorization, the resolver eventidentityis whatever the Lambda authorizer returned inresolverContext(e.g.{"resolverContext": {"userId": "u-1", "tier": "gold"}}). Previouslyget_identity_objectonly checked forsub(Cognito) and fell back toAppSyncIdentityIAMfor everything else, so a Lambda-authorizer identity was wrapped inAppSyncIdentityIAMand every property on it (account_id,user_arn, ...) raisedKeyError;resolverContextwas only reachable as a raw dict.Change
AppSyncIdentityLambda(DictWrapper)with aresolver_contextproperty returning the dict the authorizer producedget_identity_objectnow dispatches on"resolverContext" in identitybefore the IAM fallback; thesub(Cognito/OIDC) dispatch and the IAM fallback are unchangedidentityproperty return type and docstring (the AWS_LAMBDA line previously said "returns None - NEED TO TEST")docs/utilities/data_classes.mddocumenting which identity class each AppSync authorization type returnsTests
tests/events/appSyncResolverEventLambdaAuth.json(existing fixtures untouched, per repo guidance)AppSyncResolverEvent(event).identity/get_identity_object: class exposesresolver_context,resolverContextidentity dispatches toAppSyncIdentityLambda(notAppSyncIdentityIAM), IAM fallback regression withoutresolverContext, and nested-dict passthrough ofresolver_contextidentitypayload shape documented in the issue (resolverContextonly, nosubor IAM fields) — no AWS resources neededImportError/AppSyncIdentityIAMmisclassification); GREEN after fix: 10/10 in the file, 200/200 intests/unit/data_classes/required_dependencies/;ruff checkandruff format --checkclean on the changed filesRelated: #8705 deliberately leaves
AWS_LAMBDAmarked unverified ("no fixture for it") while fixing the OIDC docstring — this PR completes theAWS_LAMBDApiece it deferred. The docstring edits are on adjacent lines, so a trivial rebase may be needed if #8705 merges first.AI assistance was used for this contribution (implementation and review).
AI assistance was used for implementation and review; all reported verification is recorded above.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.