Repository navigation
Conversation
|
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.



This pull request introduces a security enhancement for the
/adm-graphqlendpoint, restricting OAuth/MCP access tokens to only allow theconfigurationquery, while leaving session JWTs unrestricted. It also updates several dependencies and CI actions. The most important changes are grouped below:Security and Access Control Improvements:
restrictOAuthGraphQL, insrc/middleware/auth.jsto restrict OAuth tokens so they can only execute top-levelconfigurationqueries on/adm-graphql. This blocks all other queries, mutations, introspection, and fragments for OAuth tokens, returning a 403 if violated. Session JWTs remain fully privileged./adm-graphqlroute insrc/app.jsto useauthAnyand the newrestrictOAuthGraphQL(['configuration'])middleware, enforcing the above restriction for OAuth tokens.authAnyto clarify that/adm-graphqlis now covered by this mixed-auth and restriction logic.Testing:
tests/oauth.test.jsto verify that OAuth tokens can only access theconfigurationquery on/adm-graphql, cannot run other queries or mutations, and that session JWTs retain full access. Also tested error handling for invalid tokens.Dependency and CI Updates:
mongooseto^9.13.0inpackage.jsonandnpm-shrinkwrap.json, including its transitive dependency onmongodb. [1] [2] [3] [4]npm-shrinkwrap.json, includingbrace-expansion,caniuse-lite,electron-to-chromium, andswagger-ui-dist. [1] [2] [3] [4]v8.4.1tov8.5.1in both.github/workflows/master.ymland.github/workflows/sonar.yml. [1] [2]These changes collectively tighten security for sensitive endpoints, improve code clarity, and keep dependencies and CI tools up to date.