Skip to content

Upgrade ThunderID v0.34 → v0.45 and fix breaking auth changes#1123

Open
yashed wants to merge 8 commits into
wso2:mainfrom
yashed:main
Open

Upgrade ThunderID v0.34 → v0.45 and fix breaking auth changes#1123
yashed wants to merge 8 commits into
wso2:mainfrom
yashed:main

Conversation

@yashed

@yashed yashed commented Jun 20, 2026

Copy link
Copy Markdown

Purpose

Upgrade ThunderID from v0.34.0 to v0.45.0. The newer versions introduced breaking changes to
the OAuth scope format, service-account token claims, and the user-invitation flow, and
exposed downstream auth breakages in OpenChoreo and the API Platform Gateway. This PR carries the
upgrade and fixes every resulting breakage so the platform continues to work end-to-end (login,
M2M auth, agent build, build logs, environment/gateway creation, invites).

Related Issue : #1080

Goals

  • Bring ThunderID up to v0.45.0
  • Fix all breaking changes caused by the version upgrade so the platform continues to work correctly

Approach

What changed in ThunderID v0.44/v0.45 and the fixes made:

Backend - agent-manager-service

  • rbac/permissions.go- Thunder now prefixes every permission scope with the resource-server
    handle (org:viewamp:org:view). Permission.Scope() now returns the amp:-prefixed form so
    RBAC checks match the scopes the new tokens carry.
  • clients/openchoreosvc/client/authz.go - client_credentials tokens now carry the client
    identifier in the client_id claim, not sub (sub is now a random UUID). EnsureClusterRoleBinding
    now uses client_id in both the create path and the idempotency check.
  • clients/openchoreosvc/auth/auth.go + main.go - added a Scope field to the OpenChoreo M2M
    auth config so client-credentials token requests include the required amp:* scopes.
  • clients/thundersvc/identity_client.go - the invitation flow went from 4 to 6 steps, with
    challenge tokens mandatory across steps and OU selection becoming action-driven. InviteUser
    refactored to the new flow.

Console

  • public/config.js, wso2-agent-manager/values.yaml, docker-compose.yml - AUTH_SCOPES /
    OAUTH_SCOPES_SUPPORTED updated to the amp:-prefixed format.
  • navigationItems.tsx - sidebar items gated on the new amp:* read scopes.
  • authHooks.ts - clear stale token payload on empty token / fetch failure; reset invite step
    before each unmarshal to avoid stale carry-over.
  • RBAC_ENABLED made overridable (console configmap + docker-compose) for zero-downtime rollout.

ThunderID extension chart (wso2-amp-thunder-extension)

  • Chart.yaml / values.yaml - bump to v0.45.0 and updated OAuth config. The amp: prefix is
    only valid on scope strings; removed it from non-scope OAuth app fields (grantTypes,
    allowedUserTypes, redirectUris, CORS allowedOrigins, userAttributes), which v0.44+
    validates strictly and otherwise rejects at startup.
  • amp-thunder-bootstrap.yaml - scoped pod/PVC ops to the release label, guard empty image,
    disable persistence to avoid PVC conflicts on reinstall.

API Platform Gateway extension chart (wso2-amp-api-platform-gateway-extension)

  • gateway-bootstrap-job.yaml - the bootstrap job requested un-prefixed scopes
    (gateway:read …); v0.45 grants nothing for those, so the minted token had no scopes and gateway
    registration failed with 403 insufficient permissions. Updated to request amp:-prefixed scopes.
  • authz-cluster-role-binding.yaml - the amp-api-client binding switched subclient_id.

OpenChoreo setup - deployments/setup/setup-openchoreo.sh

  • A plain helm upgrade doesn't re-run ThunderID's pre-install bootstrap job, leaving the old scope
    format in the DB. Detects a version mismatch, then uninstalls + deletes the PVC + reinstalls so the
    bootstrap re-seeds with the new format.
  • Patches openchoreo-api-config so the control plane resolves the service-account subject by
    client_id
    (the chart schema doesn't expose this).
  • Migrates OpenChoreo's built-in ClusterAuthzRoleBindings from subclient_id
    (workload-publisher, observer-resource-reader, backstage, finops, rca, mcp-tryout).
    After the global claim switch these stale sub bindings stop matching, so agent build
    (workload publish)
    and build-log/observability reads returned 403.
  • Patches observer-auth-config (observability plane) subclient_id - the observer keeps
    its own subject-resolution config; without this, build logs returned 403 Access denied.

User stories

N/A

Release note

Upgraded ThunderID to v0.45.0 to support Agent ID capabilities.

Documentation

N/A

Training

N/A

Certification

N/A

Marketing

N/A

Automation tests

  • Unit tests

    N/A

  • Integration tests

    Verified on k3d with ThunderID v0.45.0 - token issuance, scope validation, M2M auth,
    invite flow, agent build + build logs, and environment/gateway creation tested manually.

Security checks

Samples

N/A

Related PRs

N/A

Migrations (if applicable)

N/A

Test environment

macOS, k3d local cluster, ThunderID v0.45.0, Go 1.23

Learning

N/A

Summary by CodeRabbit

Release Notes

  • New Features

    • Adaptive, multi-step user invitation flow for more reliable Thunder onboarding.
    • RBAC-based sidebar navigation visibility, gated by updated permission scopes, including identity and admin sections.
  • Improvements

    • Updated OAuth2 scope handling across backend, gateway bootstrap, tests, and console to use amp:-prefixed permission identifiers.
    • Entitlement role binding now matches tokens using client_id (instead of sub), with automated, idempotent migration during setup/upgrade.
  • Configuration

    • Helm/docker scope allowlists and runtime scope settings refreshed to align with the new amp: scheme.

@yashed yashed requested a review from lashinijay June 20, 2026 18:30
@CLAassistant

CLAassistant commented Jun 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR upgrades the Thunder IDP dependency from v0.34.0 (Asgardeo) to v0.45.0 (ThunderID), renames all OAuth permission scopes to use an amp: resource-server prefix, switches ClusterAuthzRoleBinding entitlement claims from sub to client_id, refactors the InviteUser flow into an adaptive 6-step action-driven sequence, updates console auth token decoding from react-query to local state, and updates Thunder bootstrap provisioning to use the new IDP API endpoints and naming conventions.

Changes

amp:-prefixed OAuth scopes and ThunderID v0.45.0 upgrade

Layer / File(s) Summary
amp: scope format and OAuth config contract
agent-manager-service/rbac/permissions.go, agent-manager-service/clients/openchoreosvc/auth/auth.go, agent-manager-service/main.go, deployments/helm-charts/wso2-amp-api-platform-gateway-extension/templates/gateway-bootstrap-job.yaml
Permission.Scope() now returns amp:<resource>:<action> format with the resource-server prefix. auth.Config gains a Scope field for client-credentials token requests. fetchToken conditionally includes the scope in form data when non-empty. main.go wires OAuthScopesSupported into the Scope field via strings.Join. The gateway bootstrap job updates its token request scope parameter to the amp:-prefixed list.
ClusterAuthzRoleBinding claim: sub → client_id
agent-manager-service/clients/openchoreosvc/client/authz.go, deployments/helm-charts/wso2-amp-platform-resources-extension/templates/authz-cluster-role-binding.yaml, deployments/setup/setup-openchoreo.sh
EnsureClusterRoleBinding and its 409-conflict verification path both change the entitlement claim from sub to client_id. The Helm template ClusterAuthzRoleBinding is updated to match. The setup script deletes the openchoreo-api-config configmap before Control Plane installation, then conditionally patches the claim field post-install using YAML sed rewrite, validates the result, reapplies via server-side apply with Helm field manager, restarts deployment/openchoreo-api, and migrates existing clusterauthzrolebindings by patching their spec.entitlement.claim field.
ThunderID v0.45.0 dependency and image update
deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml, deployments/helm-charts/wso2-amp-thunder-extension/values.yaml, deployments/setup/setup-openchoreo.sh
Thunder Helm chart dependency switches from ghcr.io/asgardeo/helm-charts v0.34.0 (name: thunder) to ghcr.io/thunder-id/helm-charts v0.45.0 (name: thunderid with alias: thunder). Container image updated to ghcr.io/thunder-id/thunderid:0.45.0. The ampScopes allowlist expands to a comprehensive amp:-prefixed set covering org/project/environment/gateway/data-plane/deployment-pipeline/git-secrets/LLM/agent/monitoring/role/group/catalog/repository permissions. The setup script detects the currently running Thunder image and performs a PVC-destructive reinstall (uninstall + delete PVCs + helm upgrade) when the image version differs from the target.
Thunder bootstrap api_call migration and endpoint updates
deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml
All bootstrap scripts replace thunder_api_call with api_call across OU/auth-flow lookups, application listing, and application upsert (PUT for existing, POST for create). User-schema provisioning moves from /user-schemas to /user-types endpoints with extracted schema id and email attribute patching via PATCH /user-types/<id>. Branding upserts switch from id-based to handle-based discovery: list layouts/themes via GET /design/layouts/GET /design/themes, find matching handle, then PUT or POST. Resource server provisioning uses api_call for all helper calls. Role provisioning uses api_call and updates permission payloads to amp:-prefixed identifiers instead of unprefixed ones. Group provisioning switches default OU, group create-or-get (409 list), Administrator role lookup, and role assignment all to api_call.
InviteUser adaptive 6-step flow
agent-manager-service/clients/thundersvc/identity_client.go
InviteUser refactored from a fixed flow to an adaptive 6-step action-driven sequence: start onboarding flow → submit user type → conditionally submit OU selection (only if action_ou_selection is present in response actions) → submit invite mode (action_invite_user) → submit invitee email (action_submit_email) → request share-link (action_share_manually). Each step updates challengeToken from the response. Final invite link is extracted from the share-link response body instead of the email-submission response; missing link error now reports the final response body.
Console auth token decoding and RBAC nav visibility
console/workspaces/libs/auth/src/asgardio/hooks/authHooks.ts, console/workspaces/core-ui/src/Layouts/OxygenLayout/navigationItems.tsx, console/apps/web-ui/public/config.js
useAuthHooks replaces react-query-based token decoding with useState/useEffect/useRef state management. Access token is fetched via a getAccessToken ref, decoded via decodeJWT, stored as accessTokenPayload, and cleared on unmount or when not signed in. userInfo merges accessTokenPayload directly into the profile instead of the removed tokenInfo.payload. Navigation visibility checks in useNavigationItems switch to amp:-prefixed scope strings for resources, evaluation, infrastructure, identity, and role/group sections. Console config.js authConfig.scopes updated to the expanded amp:*-prefixed scope set.
Deployment config scope, audience, and RBAC flag updates
deployments/docker-compose.yml, deployments/helm-charts/wso2-agent-manager/values.yaml, deployments/helm-charts/wso2-agent-manager/templates/console/configmap.yaml
docker-compose.yml replaces OAUTH_SCOPES_SUPPORTED and AUTH_SCOPES with amp:-prefixed expanded scope lists, updates KEY_MANAGER_AUDIENCE to include the amp entry, and adjusts postgres healthcheck YAML formatting. Helm agentManagerService.config.oauthScopesSupported and console.config.scopes are replaced with amp:-prefixed expanded lists. Helm agentManagerService.keyManager.audience adds the amp audience. Console ConfigMap template adds RBAC_ENABLED key sourcing from .Values.console.config.rbacEnabled with "true" default; values.yaml adds console.config.rbacEnabled: "true" to enable RBAC-based sidebar visibility.
Observability plane authorization claim migration
deployments/setup/setup-openchoreo.sh
After Observability Plane deployments are ready, the setup script conditionally patches observer-auth-config by rewriting the entitlement claim from sub to client_id in the configmap YAML, validates the result with grep, reapplies via server-side apply with --field-manager=helm, and restarts deployment/observer; if the configmap is absent it logs a warning and skips.

Sequence Diagrams

sequenceDiagram
  participant Caller
  participant InviteUser as thunderClient.InviteUser
  participant ThunderAPI as Thunder API

  rect rgba(70, 130, 180, 0.5)
    Note over Caller,ThunderAPI: Adaptive InviteUser flow (ThunderID v0.45.0)
    Caller->>InviteUser: InviteUser(ouID, email)
    InviteUser->>ThunderAPI: POST /flows/USER_ONBOARDING (start)
    ThunderAPI-->>InviteUser: challengeToken + actions[]
    InviteUser->>ThunderAPI: submit user type (action_usertype)
    ThunderAPI-->>InviteUser: challengeToken + actions[]
    alt action_ou_selection present in actions[]
      InviteUser->>ThunderAPI: submit OU selection (action_ou_selection)
      ThunderAPI-->>InviteUser: challengeToken + actions[]
    end
    InviteUser->>ThunderAPI: select invite mode (action_invite_user)
    ThunderAPI-->>InviteUser: challengeToken + actions[]
    InviteUser->>ThunderAPI: submit email (action_submit_email)
    ThunderAPI-->>InviteUser: challengeToken + actions[]
    InviteUser->>ThunderAPI: request share-link (action_share_manually)
    ThunderAPI-->>InviteUser: response body with invite link
    InviteUser-->>Caller: extractInviteLink(response)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related issues

  • #1080: This PR fulfills the ThunderID version upgrade from v0.34.0 to v0.45.0 needed to enable agent identity support through Thunder's /agents and /agent-types APIs, along with all accompanying authorization scope changes and bootstrap provisioning updates.

Possibly related PRs

  • wso2/agent-manager#914: Both PRs touch RBAC/scopes groundwork and identity/invite flows; the main PR's scope/claim changes are code-level related to that PR's identity+RBAC changes.
  • wso2/agent-manager#1019: The main PR's RBAC/OAuth scope-format changes are directly related to that PR's RBAC permission scope set expansion.
  • wso2/agent-manager#1040: Both PRs change how RBAC/OAuth scope identifiers are formed; main PR updates Permission.Scope() and scope allowlists to amp:-prefixed format while that PR refactors permission constant naming.

Suggested reviewers

  • rasika2012
  • menakaj

Poem

🐇 Hippity-hop, the scopes got a hat,
amp: prefix—imagine that!
Thunder leapt from .34 to .45,
client_id opens the auth door to survive.
Six steps to invite, adaptive and bright,
The rabbit approves—everything's right! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: upgrading ThunderID and fixing the resulting authentication breaking changes.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
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.
Description check ✅ Passed The pull request description comprehensively addresses all template sections with detailed explanations of ThunderID v0.45.0 upgrade and fixes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

@yashed yashed marked this pull request as ready for review June 22, 2026 05:39

@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.

🧹 Nitpick comments (2)
agent-manager-service/clients/thundersvc/identity_client.go (1)

937-955: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider defensive validation when action_ou_selection is present but ouID is empty.

The flow relies on Thunder not presenting action_ou_selection for single-OU deployments. However, if this action is present and ouID is empty (as set by the controller for on-prem), the request sends {"ouId": ""} which may cause unexpected behavior.

Consider adding a guard or logging:

🛡️ Suggested defensive check
 if hasAction("action_ou_selection") {
+    if ouID == "" {
+        return "", fmt.Errorf("thunder invite user: OU selection required but ouID is empty")
+    }
     body, err = c.doRequest(ctx, http.MethodPost, c.baseURL+"/flow/execute", token,
🤖 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 `@agent-manager-service/clients/thundersvc/identity_client.go` around lines 937
- 955, The code in the hasAction("action_ou_selection") block sends a request
with ouID as an empty string when ouID is not provided in on-prem deployments,
which may cause unexpected behavior in Thunder. Add defensive validation before
the doRequest call within the hasAction("action_ou_selection") conditional to
check if ouID is empty and either return an error with a descriptive message,
log a warning about the empty ouID, or skip this step entirely to prevent
sending invalid data to the Thunder API.
deployments/scripts/setup-openchoreo.sh (1)

320-351: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider edge case: pods may not exist or be in non-Running state.

The version detection relies on pods existing with the matching label. If the release exists but pods are pending, crashlooping, or not yet created, kubectl get pods may return no image, triggering the abort path at line 337-338.

This is likely acceptable for a development/setup script, but worth noting that re-running the script during a transient pod state could fail unnecessarily.

💡 Optional: Add brief wait or check deployment replicas
     if helm status amp-thunder-extension -n amp-thunder &>/dev/null; then
+        # Give pods a moment to schedule if release just deployed
+        kubectl wait -n amp-thunder --for=condition=ready pod -l "$selector" --timeout=30s 2>/dev/null || true
         local current_image
         current_image=$(kubectl get pods -n amp-thunder -l "$selector" \
🤖 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 `@deployments/scripts/setup-openchoreo.sh` around lines 320 - 351, The version
detection logic queries pod images directly using kubectl get pods, but fails if
the Helm release exists while pods are still pending, crashlooping, or not yet
scheduled. Instead of immediately checking pods for the image when the selector
matches, add a brief wait for deployment readiness (or check the deployment
replicas to ensure pods are expected to exist) before querying the
current_image. This prevents unnecessary aborts when re-running the script
during transient pod states where the release exists but pods haven't fully
initialized yet.
🤖 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.

Nitpick comments:
In `@agent-manager-service/clients/thundersvc/identity_client.go`:
- Around line 937-955: The code in the hasAction("action_ou_selection") block
sends a request with ouID as an empty string when ouID is not provided in
on-prem deployments, which may cause unexpected behavior in Thunder. Add
defensive validation before the doRequest call within the
hasAction("action_ou_selection") conditional to check if ouID is empty and
either return an error with a descriptive message, log a warning about the empty
ouID, or skip this step entirely to prevent sending invalid data to the Thunder
API.

In `@deployments/scripts/setup-openchoreo.sh`:
- Around line 320-351: The version detection logic queries pod images directly
using kubectl get pods, but fails if the Helm release exists while pods are
still pending, crashlooping, or not yet scheduled. Instead of immediately
checking pods for the image when the selector matches, add a brief wait for
deployment readiness (or check the deployment replicas to ensure pods are
expected to exist) before querying the current_image. This prevents unnecessary
aborts when re-running the script during transient pod states where the release
exists but pods haven't fully initialized yet.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 453b14c0-f1b3-4537-bbfe-24a114118ed4

📥 Commits

Reviewing files that changed from the base of the PR and between 234ab4f and 57881aa.

⛔ Files ignored due to path filters (1)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • agent-manager-service/clients/openchoreosvc/auth/auth.go
  • agent-manager-service/clients/openchoreosvc/client/authz.go
  • agent-manager-service/clients/thundersvc/identity_client.go
  • agent-manager-service/main.go
  • agent-manager-service/rbac/permissions.go
  • console/apps/web-ui/public/config.js
  • console/workspaces/core-ui/src/Layouts/OxygenLayout/navigationItems.tsx
  • console/workspaces/libs/auth/src/asgardio/hooks/authHooks.ts
  • deployments/docker-compose.yml
  • deployments/helm-charts/wso2-agent-manager/templates/console/configmap.yaml
  • deployments/helm-charts/wso2-agent-manager/values.yaml
  • deployments/helm-charts/wso2-amp-api-platform-gateway-extension/templates/gateway-bootstrap-job.yaml
  • deployments/helm-charts/wso2-amp-platform-resources-extension/templates/authz-cluster-role-binding.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/values.yaml
  • deployments/scripts/setup-openchoreo.sh

@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: 1

🤖 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 `@deployments/setup/setup-openchoreo.sh`:
- Around line 343-346: The PVC deletion command uses || true which silently
ignores failures, allowing the script to proceed even if deletion fails,
potentially causing the helm install to reuse a stale PVC. Replace the silent
failure handling (|| true) with explicit verification that checks if the PVCs
were actually deleted after the kubectl delete pvc command executes. If PVCs
still exist after deletion, the script should exit with an error or retry
deletion before proceeding to the subsequent helm install command. Update or add
logic after the kubectl delete pvc line and before the "✅ Existing Thunder
release removed" echo statement to validate that the PVC deletion was
successful.
🪄 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: 36c09c1b-3c29-48b8-a07b-4a9d92d85a6b

📥 Commits

Reviewing files that changed from the base of the PR and between 57881aa and 95f0464.

⛔ Files ignored due to path filters (1)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • agent-manager-service/clients/openchoreosvc/auth/auth.go
  • agent-manager-service/clients/openchoreosvc/client/authz.go
  • agent-manager-service/clients/thundersvc/identity_client.go
  • agent-manager-service/main.go
  • agent-manager-service/rbac/permissions.go
  • console/apps/web-ui/public/config.js
  • console/workspaces/core-ui/src/Layouts/OxygenLayout/navigationItems.tsx
  • console/workspaces/libs/auth/src/asgardio/hooks/authHooks.ts
  • deployments/docker-compose.yml
  • deployments/helm-charts/wso2-agent-manager/templates/console/configmap.yaml
  • deployments/helm-charts/wso2-agent-manager/values.yaml
  • deployments/helm-charts/wso2-amp-api-platform-gateway-extension/templates/gateway-bootstrap-job.yaml
  • deployments/helm-charts/wso2-amp-platform-resources-extension/templates/authz-cluster-role-binding.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/values.yaml
  • deployments/setup/setup-openchoreo.sh
✅ Files skipped from review due to trivial changes (1)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
🚧 Files skipped from review as they are similar to previous changes (15)
  • deployments/helm-charts/wso2-agent-manager/templates/console/configmap.yaml
  • agent-manager-service/clients/openchoreosvc/client/authz.go
  • deployments/helm-charts/wso2-amp-platform-resources-extension/templates/authz-cluster-role-binding.yaml
  • deployments/helm-charts/wso2-amp-api-platform-gateway-extension/templates/gateway-bootstrap-job.yaml
  • agent-manager-service/clients/openchoreosvc/auth/auth.go
  • agent-manager-service/rbac/permissions.go
  • agent-manager-service/clients/thundersvc/identity_client.go
  • console/apps/web-ui/public/config.js
  • deployments/helm-charts/wso2-agent-manager/values.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/values.yaml
  • agent-manager-service/main.go
  • deployments/docker-compose.yml
  • console/workspaces/libs/auth/src/asgardio/hooks/authHooks.ts
  • console/workspaces/core-ui/src/Layouts/OxygenLayout/navigationItems.tsx
  • deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml

Comment thread deployments/setup/setup-openchoreo.sh Outdated
@yashed yashed changed the title Upgrade ThunderID v0.34 → v0.44 and fix breaking auth changes Upgrade ThunderID v0.34 → v0.45 and fix breaking auth changes Jun 22, 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.

Actionable comments posted: 1

🤖 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 `@deployments/helm-charts/wso2-amp-thunder-extension/values.yaml`:
- Around line 84-103: The consent database path configuration is still using the
old path structure while the config, runtime, and user databases have been
migrated to the new database directory structure. Locate the
configuration.consent.database.sqlitePath setting (currently pointing to
repository/database/consentdb.db) and update it to use the new path structure
(database/consentdb.db) to match the migrated paths for the config, runtime, and
user database entries, ensuring all database paths reference the same location
directory.
🪄 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: 97faaac2-69bc-4fc4-9109-e3de40deac4f

📥 Commits

Reviewing files that changed from the base of the PR and between 95f0464 and 9f89761.

⛔ Files ignored due to path filters (1)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/values.yaml
  • deployments/setup/setup-openchoreo.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml

Comment thread deployments/helm-charts/wso2-amp-thunder-extension/values.yaml
yashed added 5 commits June 23, 2026 16:19
- Prefix scopes with amp: resource server handle
- Switch OpenChoreo entitlement claim from sub to client_id
- Refactor InviteUser to 6-step flow with challenge token threading
- Auto-detect and reinstall stale ThunderID on version mismatch
- Scope Thunder pod/PVC ops to release label; guard empty image
- Disable Thunder persistence to avoid PVC conflicts on reinstall
- Fix openchoreo-api-config patch to avoid Helm field manager conflicts
- Reset invite flow step before each unmarshal to prevent stale carry-over
- Clear stale token payload on empty token or fetch failure
- Add missing read scopes for resources and infrastructure nav sections
-Migrate built-in ClusterAuthzRoleBindings sub→client_id and patch
-observer-auth-config in setup-openchoreo.sh so build logs and agent
-build/workload-publish stop 403ing after the ThunderID upgrade; bump
version comments to v0.45.

@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: 6

🤖 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
`@deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml`:
- Around line 161-164: The grep condition that checks for the presence of an
email attribute is searching the entire BODY response instead of checking only
the matched schema identified by SCHEMA_ID. This means if any other user type in
the response contains an email attribute, the patch operation will be skipped
even if the target schema is missing email. Instead of grepping the entire BODY
output, extract and check the email attribute only from the specific schema that
matches the target schema name, ensuring the patch is applied only when the
target schema itself lacks the email attribute.
- Around line 286-309: When a layout with matching handle is found and
EXISTING_LAYOUT_ID is discovered from the API response, the LAYOUT_PAYLOAD
variable still contains the static ID from the Helm values through the toJson
filter. Before calling the api_call PUT function with EXISTING_LAYOUT_ID in the
URL path, update the LAYOUT_PAYLOAD to replace its ID field with the actual
EXISTING_LAYOUT_ID value discovered from the database to ensure consistency
between the URL path parameter and the request body, preventing data integrity
issues from mismatched IDs.

In `@deployments/helm-charts/wso2-amp-thunder-extension/values.yaml`:
- Around line 20-22: The setup script comments reference ThunderID version
0.45.0, but all actual version pins are set to 0.44.0 across configuration files
including the tag field in values.yaml, the version field in Chart.yaml, and the
target_image reference in setup-openchoreo.sh. Choose one approach to resolve
this inconsistency: either update all version pin references (the tag, version
fields, and target_image values) to 0.45.0 to match the comments, or update the
setup script comments to reference 0.44.0 to match the current configuration.
Ensure consistency across all version references before finalizing the release.
- Around line 165-257: Update all scope requests in test/e2e/framework/auth.go
(lines 42-61) to include the "amp:" prefix to match the allowlist defined in
values.yaml. The current requests use unprefixed scopes like
"agent-kind:create", "org:view", "agent:build", etc., but the allowlist only
grants "amp:"-prefixed versions (e.g., "amp:agent-kind:create", "amp:org:view").
Add the "amp:" prefix to every scope string in that scope request list to ensure
they intersect with the allowlist and prevent 403 RBAC failures.

In `@deployments/setup/setup-openchoreo.sh`:
- Around line 388-389: The helm uninstall command for amp-thunder-extension at
line 388 uses || true which silently ignores all failures, allowing the script
to proceed to PVC deletion and reinstall even when the uninstall fails, risking
stale resources. Remove the || true operator from the helm uninstall
amp-thunder-extension command and add explicit error checking that either exits
the script with a clear error message or logs a failure and prevents further
execution if the uninstall fails. This ensures the script only continues with
PVC operations after confirming a successful uninstall.
- Around line 103-105: The kubectl patch command for
clusterauthzrolebinding.openchoreo.dev is suppressing all error output with
>/dev/null 2>&1 and only logging success with &&, which means patch failures go
unnoticed while the script continues. Remove the error suppression redirection
and add explicit error handling by checking the patch command's exit status with
a conditional statement that exits the script with an error message if the patch
fails, ensuring stale bindings with the old claim value cannot silently remain.
🪄 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: b3db2f98-a0d1-4c4d-932e-406723c3c6f2

📥 Commits

Reviewing files that changed from the base of the PR and between 9f89761 and d40a9d4.

⛔ Files ignored due to path filters (1)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • agent-manager-service/clients/openchoreosvc/auth/auth.go
  • agent-manager-service/clients/openchoreosvc/client/authz.go
  • agent-manager-service/clients/thundersvc/identity_client.go
  • agent-manager-service/main.go
  • agent-manager-service/rbac/permissions.go
  • console/apps/web-ui/public/config.js
  • console/workspaces/core-ui/src/Layouts/OxygenLayout/navigationItems.tsx
  • console/workspaces/libs/auth/src/asgardio/hooks/authHooks.ts
  • deployments/docker-compose.yml
  • deployments/helm-charts/wso2-agent-manager/templates/console/configmap.yaml
  • deployments/helm-charts/wso2-agent-manager/values.yaml
  • deployments/helm-charts/wso2-amp-api-platform-gateway-extension/templates/gateway-bootstrap-job.yaml
  • deployments/helm-charts/wso2-amp-platform-resources-extension/templates/authz-cluster-role-binding.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/values.yaml
  • deployments/setup/setup-openchoreo.sh
🚧 Files skipped from review as they are similar to previous changes (14)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
  • agent-manager-service/clients/openchoreosvc/client/authz.go
  • deployments/helm-charts/wso2-amp-api-platform-gateway-extension/templates/gateway-bootstrap-job.yaml
  • deployments/helm-charts/wso2-amp-platform-resources-extension/templates/authz-cluster-role-binding.yaml
  • deployments/helm-charts/wso2-agent-manager/templates/console/configmap.yaml
  • agent-manager-service/clients/openchoreosvc/auth/auth.go
  • console/workspaces/core-ui/src/Layouts/OxygenLayout/navigationItems.tsx
  • deployments/helm-charts/wso2-agent-manager/values.yaml
  • agent-manager-service/rbac/permissions.go
  • console/apps/web-ui/public/config.js
  • console/workspaces/libs/auth/src/asgardio/hooks/authHooks.ts
  • agent-manager-service/main.go
  • agent-manager-service/clients/thundersvc/identity_client.go
  • deployments/docker-compose.yml

Comment on lines +20 to +22
registry: ghcr.io/thunder-id
repository: thunderid
tag: "0.44.0"

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.

🗄️ Data Integrity & Integration | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify all ThunderID version/image references agree on one target.
# Expect: one intended ThunderID version across chart values, chart dependencies, and setup logic.

rg -n 'thunderid:0\.(44|45)\.0|version: 0\.(44|45)\.0|0\.(44|45)\.0|ghcr\.io/thunder-id/thunderid' \
  deployments/helm-charts/wso2-amp-thunder-extension deployments/setup/setup-openchoreo.sh

Repository: wso2/agent-manager

Length of output: 768


Resolve version mismatch: setup comments reference v0.45.0 but all version pins are 0.44.0.

The setup script comments at lines 69 and 259 reference ThunderID v0.45.0, but the actual version pins across all configuration files are set to 0.44.0:

  • values.yaml line 22: tag: "0.44.0"
  • Chart.yaml line 24: version: "0.44.0"
  • setup-openchoreo.sh line 374: target_image="ghcr.io/thunder-id/thunderid:0.44.0"

Either update the comments to reflect 0.44.0 or upgrade all version pins to 0.45.0 to ensure consistency before release.

🤖 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 `@deployments/helm-charts/wso2-amp-thunder-extension/values.yaml` around lines
20 - 22, The setup script comments reference ThunderID version 0.45.0, but all
actual version pins are set to 0.44.0 across configuration files including the
tag field in values.yaml, the version field in Chart.yaml, and the target_image
reference in setup-openchoreo.sh. Choose one approach to resolve this
inconsistency: either update all version pin references (the tag, version
fields, and target_image values) to 0.45.0 to match the comments, or update the
setup script comments to reference 0.44.0 to match the current configuration.
Ensure consistency across all version references before finalizing the release.

Comment thread deployments/helm-charts/wso2-amp-thunder-extension/values.yaml
Comment thread deployments/setup/setup-openchoreo.sh Outdated
Comment thread deployments/setup/setup-openchoreo.sh Outdated
- Bump thunder subchart to 0.45.0 (Chart.yaml, Chart.lock, image tag) and
  move config paths to the v0.45 layout (config/certs/*, database/*.db)
- amp:-prefix the e2e auth client_credentials scopes so RBAC routes no longer 403
- Abort the Thunder reinstall in setup-openchoreo.sh if `helm uninstall` fails
  (don't delete PVCs on a half-removed release); simplify migration comments

@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.

♻️ Duplicate comments (1)
deployments/helm-charts/wso2-amp-thunder-extension/values.yaml (1)

83-138: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Consent DB path not migrated alongside config/runtime/user paths.

The config, runtime, and user SQLite paths were migrated to database/*.db (lines 87, 95, 103), but configuration.consent.database.sqlitePath at line 138 still points to repository/database/consentdb.db. This splits persisted state across the old and new base directories.

Proposed fix
       database:
         type: sqlite
-        sqlitePath: "repository/database/consentdb.db"
+        sqlitePath: "database/consentdb.db"
🤖 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 `@deployments/helm-charts/wso2-amp-thunder-extension/values.yaml` around lines
83 - 138, The consent database path is inconsistent with the other database
paths in the values file. The config, runtime, and user database paths under the
database section use the pattern database/*.db, but the sqlitePath field under
consent.database still references the old repository/database/ directory
structure. Update the sqlitePath value under the consent database configuration
to follow the same pattern as the other databases by changing it to point to
database/consentdb.db instead of repository/database/consentdb.db to maintain
consistency across all database paths.
🤖 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.

Duplicate comments:
In `@deployments/helm-charts/wso2-amp-thunder-extension/values.yaml`:
- Around line 83-138: The consent database path is inconsistent with the other
database paths in the values file. The config, runtime, and user database paths
under the database section use the pattern database/*.db, but the sqlitePath
field under consent.database still references the old repository/database/
directory structure. Update the sqlitePath value under the consent database
configuration to follow the same pattern as the other databases by changing it
to point to database/consentdb.db instead of repository/database/consentdb.db to
maintain consistency across all database paths.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7c704565-709e-48c5-8b5e-5136329d2c56

📥 Commits

Reviewing files that changed from the base of the PR and between d40a9d4 and 2b75a91.

⛔ Files ignored due to path filters (1)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml
  • deployments/helm-charts/wso2-amp-thunder-extension/values.yaml
  • deployments/setup/setup-openchoreo.sh
  • test/e2e/framework/auth.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • deployments/helm-charts/wso2-amp-thunder-extension/Chart.yaml
  • deployments/setup/setup-openchoreo.sh
  • deployments/helm-charts/wso2-amp-thunder-extension/templates/amp-thunder-bootstrap.yaml

- setup-openchoreo.sh: abort the Thunder reinstall if `helm uninstall` fails
  (don't delete PVCs on a half-removed release), and fail fast if a
  ClusterAuthzRoleBinding sub→client_id patch fails instead of silently skipping
- amp-thunder-bootstrap.yaml: align the layout payload id with the existing
  layout's id before PUT, and scope the email-attribute check to the matched
  user schema instead of grepping the whole /user-types response
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.

3 participants