Skip to content

feat: added support to aggregator API for oauth clients (PR1) - #596

Merged
petruki merged 1 commit into
masterfrom
staging
Nov 24, 2026
Merged

petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki

@petruki petruki commented Nov 24, 2026

Copy link
Copy Markdown
Member

This pull request introduces a security enhancement for the /adm-graphql endpoint, restricting OAuth/MCP access tokens to only allow the configuration query, 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:

  • Added a new middleware function, restrictOAuthGraphQL, in src/middleware/auth.js to restrict OAuth tokens so they can only execute top-level configuration queries 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.
  • Updated /adm-graphql route in src/app.js to use authAny and the new restrictOAuthGraphQL(['configuration']) middleware, enforcing the above restriction for OAuth tokens.
  • Updated documentation in authAny to clarify that /adm-graphql is now covered by this mixed-auth and restriction logic.

Testing:

  • Added comprehensive tests in tests/oauth.test.js to verify that OAuth tokens can only access the configuration query 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:

  • Upgraded mongoose to ^9.13.0 in package.json and npm-shrinkwrap.json, including its transitive dependency on mongodb. [1] [2] [3] [4]
  • Updated several npm dependencies in npm-shrinkwrap.json, including brace-expansion, caniuse-lite, electron-to-chromium, and swagger-ui-dist. [1] [2] [3] [4]
  • Bumped SonarCloud scan GitHub Action from v8.4.1 to v8.5.1 in both .github/workflows/master.yml and .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.

@petruki petruki added this to the v1.4.1 milestone Nov 24, 2026
@petruki petruki self-assigned this Nov 24, 2026
@petruki petruki added enhancement New feature or request ai-generated Indicates that AI tools were used to generate this change labels Nov 24, 2026
@sonarqubecloud

Copy link
Copy Markdown

@petruki
petruki merged commit cf8b925 into master Nov 24, 2026
5 checks passed
@petruki
petruki deleted the staging branch November 24, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Indicates that AI tools were used to generate this change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant