Skip to content

Feature/kc 26#1369

Merged
Elson9 merged 124 commits intodevfrom
feature/kc-26
Mar 13, 2026
Merged

Feature/kc 26#1369
Elson9 merged 124 commits intodevfrom
feature/kc-26

Conversation

@ikethecoder
Copy link
Member

@ikethecoder ikethecoder commented Mar 10, 2026

PR Summary

Keycloak 15 → 26 upgrade support

  • Keycloak service layer

    • Updated client-service, client-policy-service, client-registration-service, client-roles, group-service, user-service, namespace-details, token-service, and related org-group/UMA services to align with Keycloak 26 APIs and behavior.
  • Realm and local Keycloak setup

    • Updated local/keycloak/master-realm.json for Keycloak 26 schema/fields.
    • Added local/keycloak/Dockerfile for Keycloak 26 and local/keycloak/nginx-lb.conf for the new deployment topology.
  • OAuth2-proxy and auth integration

    • Adjusted src/auth/auth-oauth2-proxy.js, src/auth/auth-tsoa.ts, and added src/auth/forbidden-error.ts for Keycloak 26 token handling and forbidden responses.
    • Updated OAuth2-proxy configs under local/oauth2-proxy/.
  • E2E and tests for Keycloak 26

    • Updated Cypress page objects and tests (Keycloak clients, scopes, groups, users, org assignment, APS API, permissions, shared IDP).
    • Updated fixtures and mocks (src/test/mocks/handlers/data/keycloak.yaml, src/test/mocks/handlers/keycloak.ts) and integrated Keycloak/org-groups tests.

Other changes

  • CI and test tooling

    • Tweaks to GitHub Actions workflows, Jest/babel setup, and batch worker; expanded APS-related E2E tests and fixtures.
  • Local/dev environment

    • Updates to docker-compose, local Dockerfiles (Kong, portal, E2E), DB/Keystone init scripts, and .env.local / .nvmrc.
  • App and dependencies

    • Small change to the signout page; refreshed dependency lockfiles under src/

🚀 Feature branch deployment: https://api-services-portal-feature-kc-26.apps.silver.devops.gov.bc.ca

@rustyjux
Copy link
Contributor

rustyjux commented Mar 11, 2026

Alright we have 5 fails in #1371, same as I did back in Dec:

Fiddly Cypress issue:

  • 07-manage-control/02-rate-limiting.cy.ts - verify rate limit error when the API calls beyond the limit
  • 07-manage-control/02-rate-limiting.cy.ts - verify rate limit error when the API calls beyond the limit

These seem like real issues, all 3 show 403s instead of 200s when trying to get activity:

  • 15-aps-api/08-namespaces.cy.ts - Get the resource and verify the success code in the response (calling namespaces/{gatewayId}/activity)
  • 19-api-v3/03-gateways.ts - POST /gateways (failure when calling /activity)
  • 19-api-v3/03-gateways.ts - GET /gateways/{gatewayId}/activity (similar to first one here)

Replicating locally, the error for the above 3 is Missing required scope: <gatewayid>:Namespace.View. Meanwhile, I can view activity in Portal at /manager/activity.

Looking back, I see that in Dec I added and then removed Namespace.View upon gateway creation, presumably related to this bug.

My notes captured that users should NOT be able to view gateway/ns/activity without Namespace.View explicitly there - but it was possible in KC15 due to bug with resource-based scopes (https://dpdd.atlassian.net/browse/APS-3972).

@ikethecoder do you remember why we removed the change to add that permission on gateway creation? Do we want to A) modify/remove these tests, B) grant the Namespace.View scope manually in the tests so they pass, or C) grant .View on ns creation. ? I'm leaning towards B.

There is also a build error now, which is reproducible locally when running docker compose --profile testsuite build, I see @Elson9 is working on it.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@ikethecoder
Copy link
Member Author

ikethecoder commented Mar 12, 2026

I can't recall why - but I agree option B. I think we had talked about a "more correct" solution is to configure the /manager/activity endpoint to be accessed with either Namespace.View or Namespace.Manage.

@danebenal danebenal self-requested a review March 12, 2026 20:16
@github-actions
Copy link
Contributor

🔔 Friendly reminder: The following reviewers still need to review this PR: @rustyjux, @phowells, @Elson9, @danebenal

PS: @sdqdadat

@ikethecoder ikethecoder removed the WIP Any PRs still in progress label Mar 13, 2026
@Elson9 Elson9 merged commit 99904fc into dev Mar 13, 2026
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants