Skip to content

Upgrade multiple dependencies and node version#2754

Merged
Piumal1999 merged 8 commits into
wso2:mainfrom
Piumal1999:dep-bump
Jul 21, 2026
Merged

Upgrade multiple dependencies and node version#2754
Piumal1999 merged 8 commits into
wso2:mainfrom
Piumal1999:dep-bump

Conversation

@Piumal1999

@Piumal1999 Piumal1999 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fix #2619

Approach

  • Upgraded node version to 24 (previously it was 23 , which is not an LTS version)
  • Updated few other dependencies
  • Refined the package.json
  • Removed unused imports in the codebase
  • Added eslint

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Developer Portal moves to Node.js 24, updates dependencies and package metadata, adds YAML and JWT compatibility utilities, modernizes JWT handling, introduces flat ESLint configuration, and adapts routing for Express 5.

Changes

Developer Portal modernization

Layer / File(s) Summary
Runtime and dependency alignment
portals/developer-portal/.nvmrc, portals/developer-portal/Dockerfile, portals/developer-portal/package.json, portals/developer-portal/it/*, portals/developer-portal/Makefile, portals/developer-portal/src/app.js, portals/developer-portal/src/dao/subscriptionPlanDao.js
Node.js images and prerequisites move to v24, package metadata and dependencies are revised, version updates use npm version, and UUIDs use crypto.randomUUID().
YAML compatibility layer
portals/developer-portal/src/utils/yaml.js, portals/developer-portal/src/controllers/*, portals/developer-portal/src/services/*, portals/developer-portal/src/utils/*
A local js-yaml wrapper restores empty-input behavior, and YAML consumers use the wrapper.
JWT decoding and claim extraction
portals/developer-portal/src/utils/jwtDecode.js, portals/developer-portal/src/utils/platformJwt.js, portals/developer-portal/src/middlewares/*, portals/developer-portal/src/controllers/authController.js
JWT decoding uses jose-based helpers, platform claims support separate verification and decoding paths, and authentication call sites use the new helpers.
Express 5 route compatibility
portals/developer-portal/src/routes/pages/*, portals/developer-portal/src/routes/api/devportalApiRouter.js, portals/developer-portal/src/scripts/common.js
Route guards, regular-expression matchers, named wildcards, simplified path matching, and boolean format validation replace incompatible patterns and settings.
Lint configuration and cleanup
portals/developer-portal/eslint.config.mjs, portals/developer-portal/src/*, portals/developer-portal/.gitignore
Adds flat ESLint configuration and removes unused imports, variables, and file-level lint suppressions across portal modules and scripts.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Request
  participant AuthMiddleware
  participant PlatformJwt
  participant Jose
  Request->>AuthMiddleware: provide access or platform token
  AuthMiddleware->>PlatformJwt: verifyPlatformJwtClaims or safeDecodeJwt
  PlatformJwt->>Jose: jwtVerify or decodeJwt
  Jose-->>PlatformJwt: JWT payload
  PlatformJwt-->>AuthMiddleware: claims and scopes
  AuthMiddleware-->>Request: continue authentication flow
Loading

Possibly related PRs

Suggested reviewers: pubudu538, malinthaprasan, renuka-fernando, tharindu1st, anugayan

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is largely incomplete: it only covers Purpose and Approach and omits most required template sections. Add the missing Goals, User stories, Documentation, Tests, Security checks, Samples, Related PRs, and Test environment sections.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: a Node.js version bump and dependency upgrades.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread portals/developer-portal/it/rest-api/package-lock.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
portals/developer-portal/src/utils/platformJwt.js (1)

32-40: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Avoid polymorphic verify-or-decode functions.

Functions that dynamically switch between verifying and purely decoding a JWT based on the presence of a secret parameter are a common source of authentication bypass vulnerabilities (e.g., if a caller accidentally passes a falsy value when a config value is missing).
Consider splitting this into two explicit functions: verifyPlatformJwtClaims(token, secret) and decodePlatformJwtClaims(token) to prevent accidental misuse.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@portals/developer-portal/src/utils/platformJwt.js` around lines 32 - 40,
Replace the polymorphic extractPlatformJwtClaims function with explicit
verifyPlatformJwtClaims(token, secret) and decodePlatformJwtClaims(token)
functions. Keep JWT verification, including the HS256 restriction, only in the
verify function, and keep decoding only in the decode function; update callers
to choose the intended operation explicitly rather than branching on a falsy
secret.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@portals/developer-portal/src/middlewares/authMiddleware.js`:
- Around line 164-167: Update the authentication logic around
extractPlatformJwtClaims so a missing or falsy config.platformApi.jwtSecret
immediately returns { valid: false, scopes: '' } rather than decoding the token
without verification. Only call extractPlatformJwtClaims and accept claims when
a configured secret is present, preserving invalid-token handling for configured
secrets.

In `@portals/developer-portal/src/utils/platformJwt.js`:
- Around line 35-37: Replace the shared-secret HS256 verification in the
jwtVerify call within platform JWT handling with asymmetric-key verification,
explicitly restricting algorithms to the approved asymmetric set such as RS256,
RS384, RS512, PS256, or EdDSA; never permit none or any HS* algorithm, and
update key loading to use the corresponding asymmetric public key.

---

Nitpick comments:
In `@portals/developer-portal/src/utils/platformJwt.js`:
- Around line 32-40: Replace the polymorphic extractPlatformJwtClaims function
with explicit verifyPlatformJwtClaims(token, secret) and
decodePlatformJwtClaims(token) functions. Keep JWT verification, including the
HS256 restriction, only in the verify function, and keep decoding only in the
decode function; update callers to choose the intended operation explicitly
rather than branching on a falsy secret.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9cacbc9e-b86d-4e4e-a418-6377d8574bea

📥 Commits

Reviewing files that changed from the base of the PR and between e1426b0 and 28a36d9.

⛔ Files ignored due to path filters (2)
  • portals/developer-portal/it/rest-api/package-lock.json is excluded by !**/package-lock.json
  • portals/developer-portal/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (32)
  • portals/developer-portal/.nvmrc
  • portals/developer-portal/Dockerfile
  • portals/developer-portal/Makefile
  • portals/developer-portal/README.md
  • portals/developer-portal/it/docker-compose.test.postgres.yaml
  • portals/developer-portal/it/docker-compose.test.yaml
  • portals/developer-portal/it/rest-api/package.json
  • portals/developer-portal/package.json
  • portals/developer-portal/src/app.js
  • portals/developer-portal/src/controllers/apiContentController.js
  • portals/developer-portal/src/controllers/apiWorkflowsController.js
  • portals/developer-portal/src/controllers/authController.js
  • portals/developer-portal/src/controllers/devportalController.js
  • portals/developer-portal/src/dao/subscriptionPlanDao.js
  • portals/developer-portal/src/middlewares/authMiddleware.js
  • portals/developer-portal/src/middlewares/ensureAuthenticated.js
  • portals/developer-portal/src/middlewares/passportConfig.js
  • portals/developer-portal/src/routes/api/devportalApiRouter.js
  • portals/developer-portal/src/routes/pages/apiContentRoute.js
  • portals/developer-portal/src/routes/pages/customPageRoute.js
  • portals/developer-portal/src/routes/pages/designModeRoute.js
  • portals/developer-portal/src/services/adminService.js
  • portals/developer-portal/src/services/apiMetadataService.js
  • portals/developer-portal/src/services/apiWorkflowService.js
  • portals/developer-portal/src/services/keyManagerService.js
  • portals/developer-portal/src/services/mcpRegistryService.js
  • portals/developer-portal/src/utils/apiDefinitionUtil.js
  • portals/developer-portal/src/utils/jwtDecode.js
  • portals/developer-portal/src/utils/platformJwt.js
  • portals/developer-portal/src/utils/sampleApiLoader.js
  • portals/developer-portal/src/utils/util.js
  • portals/developer-portal/src/utils/yaml.js
💤 Files with no reviewable changes (1)
  • portals/developer-portal/src/utils/util.js

Comment thread portals/developer-portal/src/middlewares/authMiddleware.js Outdated
Comment thread portals/developer-portal/src/utils/platformJwt.js Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 21, 2026
@Piumal1999 Piumal1999 changed the title Upgrade multiple dependencies Upgrade multiple dependencies and node version Jul 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
portals/developer-portal/src/middlewares/registerPartials.js (1)

108-108: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Prevent fall-through to the next middleware after an error.

Calling next(error) without return causes the function to continue execution and hit next() on line 111. This double invocation will cause Express to run both the error handler and the next standard route handler, leading to an ERR_HTTP_HEADERS_SENT exception when both try to respond to the client.

🐛 Proposed fix to return early
-      next(error);
+      return next(error);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@portals/developer-portal/src/middlewares/registerPartials.js` at line 108,
Update the error path in the middleware function containing next(error) to
return immediately after forwarding the error, preventing execution from
reaching the later next() call. Preserve the existing success path and normal
middleware continuation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@portals/developer-portal/src/middlewares/registerPartials.js`:
- Line 108: Update the error path in the middleware function containing
next(error) to return immediately after forwarding the error, preventing
execution from reaching the later next() call. Preserve the existing success
path and normal middleware continuation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9bb402b8-c7e1-47f2-ba44-400db273031f

📥 Commits

Reviewing files that changed from the base of the PR and between 28a36d9 and 2f0b891.

⛔ Files ignored due to path filters (1)
  • portals/developer-portal/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (58)
  • portals/developer-portal/.gitignore
  • portals/developer-portal/eslint.config.mjs
  • portals/developer-portal/it/rest-api/support/fixtures.js
  • portals/developer-portal/package.json
  • portals/developer-portal/src/app.js
  • portals/developer-portal/src/config/logger.js
  • portals/developer-portal/src/controllers/apiContentController.js
  • portals/developer-portal/src/controllers/apiKeysOverviewController.js
  • portals/developer-portal/src/controllers/apiKeysPageController.js
  • portals/developer-portal/src/controllers/apiWorkflowsController.js
  • portals/developer-portal/src/controllers/applicationsContentController.js
  • portals/developer-portal/src/controllers/authController.js
  • portals/developer-portal/src/controllers/customContentController.js
  • portals/developer-portal/src/controllers/devportalController.js
  • portals/developer-portal/src/controllers/orgContentController.js
  • portals/developer-portal/src/controllers/subscriptionsContentController.js
  • portals/developer-portal/src/dao/apiDao.js
  • portals/developer-portal/src/dao/apiFileDao.js
  • portals/developer-portal/src/dao/apiKeyDao.js
  • portals/developer-portal/src/dao/applicationDao.js
  • portals/developer-portal/src/dao/subscriptionDao.js
  • portals/developer-portal/src/db/sequelizeConfig.js
  • portals/developer-portal/src/helpers/handlebarsHelpers.js
  • portals/developer-portal/src/middlewares/authMiddleware.js
  • portals/developer-portal/src/middlewares/csrfProtection.js
  • portals/developer-portal/src/middlewares/ensureAuthenticated.js
  • portals/developer-portal/src/middlewares/registerPartials.js
  • portals/developer-portal/src/models/application.js
  • portals/developer-portal/src/routes/api/devportalApiRouter.js
  • portals/developer-portal/src/routes/pages/authRoute.js
  • portals/developer-portal/src/routes/pages/settingsRoute.js
  • portals/developer-portal/src/scripts/api-keys-overview.js
  • portals/developer-portal/src/scripts/api-subscription-plans.js
  • portals/developer-portal/src/scripts/application-api-keys.js
  • portals/developer-portal/src/scripts/common.js
  • portals/developer-portal/src/scripts/dev-reload.js
  • portals/developer-portal/src/scripts/home-particles.js
  • portals/developer-portal/src/scripts/listing-cards.js
  • portals/developer-portal/src/scripts/manage-api-workflows.js
  • portals/developer-portal/src/scripts/mcp-landing.js
  • portals/developer-portal/src/scripts/mcp-subscription-plans.js
  • portals/developer-portal/src/scripts/settings-apis.js
  • portals/developer-portal/src/scripts/settings-keymanagers.js
  • portals/developer-portal/src/scripts/settings-labels.js
  • portals/developer-portal/src/scripts/settings-nav.js
  • portals/developer-portal/src/scripts/settings-organization.js
  • portals/developer-portal/src/scripts/settings-plans.js
  • portals/developer-portal/src/scripts/settings-views.js
  • portals/developer-portal/src/scripts/settings-webhooks.js
  • portals/developer-portal/src/services/adminService.js
  • portals/developer-portal/src/services/devportalService.js
  • portals/developer-portal/src/services/mcpRegistryService.js
  • portals/developer-portal/src/services/seederService.js
  • portals/developer-portal/src/services/webhooks/dispatcher.js
  • portals/developer-portal/src/utils/constants.js
  • portals/developer-portal/src/utils/platformJwt.js
  • portals/developer-portal/src/utils/sampleApiLoader.js
  • portals/developer-portal/src/utils/util.js
💤 Files with no reviewable changes (15)
  • portals/developer-portal/src/models/application.js
  • portals/developer-portal/src/routes/pages/settingsRoute.js
  • portals/developer-portal/src/services/webhooks/dispatcher.js
  • portals/developer-portal/src/controllers/orgContentController.js
  • portals/developer-portal/src/dao/apiFileDao.js
  • portals/developer-portal/src/config/logger.js
  • portals/developer-portal/src/services/seederService.js
  • portals/developer-portal/src/dao/apiKeyDao.js
  • portals/developer-portal/src/helpers/handlebarsHelpers.js
  • portals/developer-portal/src/utils/constants.js
  • portals/developer-portal/.gitignore
  • portals/developer-portal/src/routes/pages/authRoute.js
  • portals/developer-portal/src/utils/util.js
  • portals/developer-portal/src/utils/sampleApiLoader.js
  • portals/developer-portal/src/routes/api/devportalApiRouter.js
🚧 Files skipped from review as they are similar to previous changes (5)
  • portals/developer-portal/src/services/mcpRegistryService.js
  • portals/developer-portal/src/app.js
  • portals/developer-portal/src/controllers/apiWorkflowsController.js
  • portals/developer-portal/src/controllers/apiContentController.js
  • portals/developer-portal/package.json

@Piumal1999
Piumal1999 merged commit 8a8d53a into wso2:main Jul 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task][DevPortal]: Upgrade the dependencies to latest versions

2 participants