Repository navigation
docs(data_classes): correct AppSync identity docstring for OPENID_CONNECT and pin the dispatch - #8705
Conversation
…ty dispatch `AppSyncEventBase.identity` documented OPENID_CONNECT as returning None, but `get_identity_object` only returns None when the identity mapping itself is None, so an OIDC identity (which always carries `sub`) resolves to `AppSyncIdentityCognito` — which already models the OIDC fields. The existing test suite already asserted that; the docstring was the outlier. Corrects the line, drops the two `NEED TO TEST` notes for the case that is now settled, and adds tests pinning the dispatch so docstring and behaviour cannot drift apart again. `AWS_LAMBDA` is left as explicitly unverified rather than guessed at, since its mapping is whatever the authorizer returns. Signed-off-by: ShussMiao <168898188+ShussMiao@users.noreply.github.com>
|
leandrodamascena
left a comment
There was a problem hiding this comment.
Thanks @ShussMiao, that's exactly what I asked for in the issue, and the two tests pin the dispatch so the docstring can't drift again. The AWS_LAMBDA case you left open is real: that identity lands on AppSyncIdentityIAM today and shouldn't. I opened #8718 for it.
I'm approving now. This goes out in 3.40.0, so it will sit here for a while before I merge it. No rebase needed in the meantime, and you'll be credited in the release notes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8705 +/- ##
===========================================
+ Coverage 96.99% 97.00% +0.01%
===========================================
Files 321 321
Lines 16332 16415 +83
Branches 1473 1482 +9
===========================================
+ Hits 15841 15924 +83
Misses 350 350
Partials 141 141 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



Issue number: closes #8704
Summary
Changes
AppSyncEventBase.identitydocumentedOPENID_CONNECTas returningNone. It cannot:get_identity_objectreturnsNoneonly when the identity mapping itself isNone, and an OIDC identity always carriessub, so it resolves toAppSyncIdentityCognito— the class that already exposes the OIDC fields (claims,issuer,groups,default_auth_strategy).The existing suite already relied on this:
test_appsync_resolver_event.py:48assertsisinstance(parsed_event.identity, AppSyncIdentityCognito)forappSyncResolverEvent.json, whose identity is OIDC-shaped. The docstring was the outlier, and carried aNEED TO TESTnote.OPENID_CONNECTline and removes itsNEED TO TESTnote.type of identify found→type of identity found).AppSyncIdentityCognitowith its fields reachable, and "only aNoneidentity maps toNone".AWS_LAMBDAexplicitly marked unverified rather than guessing, since its mapping is whatever the authorizer returns and there is no fixture for it.User experience
No behavioural change — the docstring now matches what already happens, so anyone reading
identityto decide which class to expect for an OIDC-authorized API no longer gets told it will beNone.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.