Repository navigation
feat: read the Event API user pool identity in util.authType() - #349
Merged
Merged
Conversation
An Event API hands its handlers a user pool identity without defaultAuthStrategy, and AWS reports it as User Pool Authorization. The GraphQL schemas read that shape as an API key request, so an Event API context (one whose ctx.info names a channel namespace) gets its own user pool schema. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bentsku
marked this pull request as ready for review
November 13, 2026 21:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
An Event API hands its handlers a user pool identity that has no
defaultAuthStrategy:AWS reports that request as
User Pool Authorization. The identity schemasutil.authType()matches against are the GraphQL ones, wheredefaultAuthStrategyis required, so this identity falls through toAPI Key Authorization.What this does
When
ctx.info.channelNamespaceis set (an Event API context),util.authType()first tries a user pool schema withoutdefaultAuthStrategy, then the existing schemas. GraphQL contexts are unchanged, so a GraphQL user pool identity missingdefaultAuthStrategystill isn't read as a user pool request.The OIDC identity of an Event API (
{ claims, issuer, sub }) already matches the existing OIDC schema.Tests
Four new cases in
__tests__/authType.test.jsfor Event API contexts: the user pool identity with and withoutgroups, a user pool identity missingsourceIp(still an API key request), and the OIDC identity. The full suite passes.🤖 Generated with Claude Code