Skip to content

fix: read available roles from /obp/v7.0.0/roles instead of v2.1.0 - #7

Open
hongwei1 wants to merge 1 commit into
OpenBankProject:mainfrom
hongwei1:fix/roles-endpoint-v7
Open

hongwei1 wants to merge 1 commit into
OpenBankProject:mainfrom
hongwei1:fix/roles-endpoint-v7

Conversation

@hongwei1

Copy link
Copy Markdown
Contributor

Summary

  • The Opey consent handler and the portal roles route call GET /obp/v2.1.0/roles to list available roles.
  • Deployments that only enable newer API versions (for example OBP_API_ENABLED_VERSIONS=[OBPv4.0.0 ... OBPv7.0.0,dynamic-entity]) return OBP-10404: 404 Not Found for that URL, and the consent card shows the error.
  • /roles is defined in v2.1.0 but newer versions inherit it, so /obp/v7.0.0/roles serves the same endpoint (same roles[].role and requires_bank_id fields). On such a deployment /obp/v7.0.0/roles answers 401 without a token (route exists) while /obp/v2.1.0/roles answers 404.

Changes

  • packages/shared/src/lib/server/opey/consentHandler.ts: /obp/v2.1.0/roles -> /obp/v7.0.0/roles
  • apps/portal/src/routes/backend/obp/roles/+server.ts: /obp/v2.1.0/roles -> /obp/v7.0.0/roles

Test plan

  • On an instance without API v2.1.0 enabled, open the Opey consent card and confirm the OBP-10404 error no longer appears
  • Confirm the bank-scoped / system-scoped role selection in the consent still works

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.

1 participant