Conversation
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.
Summary by CodeRabbit
New Features
Configuration
Chores
Tests
Checklist
Marked this PR as draft since I want to create a docs PR before this is here is ready for review.
Motivation and Context
This pull requests adds the ability to configure the router to bypass authentication, if the operation is identified as an introspection query. Optionally a separate, static secret for introspection can be configured, which has to be passed via
Authorizationheader instead of the usual JWT token when an introspection query is sent.The motivation behind this feature is that it allows users to configure GraphQL client tooling without the need to acquire valid auth tokens first, which sometimes is not easy in this scenario. It's meant to be used locally. This should not be enabled in production.
To enable this feature I added a new section to the router configuration called
introspection:Changes
introspection_enabledis marked as deprecatedintrospectionwith three child parameters, as described above, addedAccessControlleris extended to know wether introspection auth bypass is enabled and what the secret isAccessControllerprovides a method to check wether the incoming operation is an introspection query (using a temporaryOperationKit) and based on it's configuration, if it should be bypassedPreHandlerfirst checks viaAccessControllerif authentication should be bypassed and skips it if truerouter-teststo disable this feature for all existing tests (to reflect the default config)router-teststo test authentication when this feature is enabled