Skip to content

Feature/aps 4674 self issue cred - #1527

Open
Elson9 wants to merge 11 commits into
devfrom
feature/aps-4674-self-issue-cred
Open

Feature/aps 4674 self issue cred#1527
Elson9 wants to merge 11 commits into
devfrom
feature/aps-4674-self-issue-cred

Conversation

@Elson9

@Elson9 Elson9 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds gateway-scoped REST APIs under /ds/api/v3 for API Providers to issue and regenerate consumer credentials with UMA scope CredentialIssuer.Generate (no Access Request / approval queue).
  • Supports kong-api-key-only, kong-api-key-acl, and client-credentials (client-secret, client-jwt, JWKS URL/cert), including application reuse across environments, optional labels, and ownerless issuer-created Applications excluded from My Access.
  • Adds independent local Cypress suite 24-self-issuing-credentials covering issue/reuse/duplicate/regenerate/authz/upstream use, Consumers UI label filter and revoke, and My Access exclusion for ownerless apps; fixes JWT regenerate to update certificates via the same path as issue.

Test plan

  • Unit: issue/regenerate workflow and CredentialIssuer.Generate scope-role tests
  • Local Cypress: npx cypress run --config-file cypress.config.ts --spec 'cypress/tests/24-self-issuing-credentials/*.cy.ts'
  • DEV smoke: SA with CredentialIssuer.Generate → POST issue → Consumers UI + labels → reuse app on second env → duplicate fails → PUT regenerate → 403 without scope → UI revoke
  • Confirm JWT regenerate returns new key material; JWKS-URL regenerate remains unsupported
  • Confirm My Access does not list ownerless issuer-created applications (04-my-access-exclusion.cy.ts)

🚀 Feature branch deployment: https://api-services-portal-feature-aps-4674-self-issue-cred.apps.silver.devops.gov.bc.ca

@ikethecoder ikethecoder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps a bit of decoration on this - maybe adding the Application description (?) or for "Application Owner" have some gray-italic content around: "Application administered by this gateway" (?)

Image

});

this.setStatus(201);
return credential;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is a removeEmpty() function that we use in other controllers to remove any null values. Perhaps could do for this, otherwise the result provides irrelevant data. For example:

{
  "flow": "client-credentials",
  "clientId": "EA7F0EF6-F3FBBBC03FF",
  "clientSecret": "***",
  "issuer": null,
  "tokenEndpoint": "http://keycloak.localtest.me:9081/auth/realms/master/protocol/openid-connect/token",
  "clientPublicKey": null,
  "clientPrivateKey": null
}

@ikethecoder ikethecoder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The "Edit" button that brings up the dialog seems to be unhappy:

Image

@ikethecoder ikethecoder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Deleting a consumer leaves the application as an orphan. May need to clean up the application when deleting the consumer.

@ikethecoder

Copy link
Copy Markdown
Member

Was able to get a credential - few suggestions above. As far as places that require the most help, it wasn't clear where to find the environmentAppId, as it does not appear on the Portal, and the other is the controls {} - when to use them, when not to, etc. I haven't done a code review yet, but functionally works great!

});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.post('/ds/api/v3/gateways/:gatewayId/consumers',
authenticateMiddleware([{"jwt":["CredentialIssuer.Generate"]}]),
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.put('/ds/api/v3/gateways/:gatewayId/consumers/:clientId',
authenticateMiddleware([{"jwt":["CredentialIssuer.Generate"]}]),
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Cypress E2E tests failed (5)

Branch: feature/aps-4674-self-issue-cred | Commit: b3a60f5

Stats
suites           120
tests            919
passes           912
pending          2
failures         5
testsRegistered  919
passPercent      99.23830250272034
pendingPercent   0.2176278563656148
other            0
hasOther         false
skipped          0
hasSkipped       false
start            2026-08-06T18:47:12.304Z
end              2026-08-06T20:02:51.718Z
duration         4539414

Failed tests (5)

  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Navigate to Users Page
  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Search Wendy (Credential Issuer) from the user list
  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Navigate to Groups tab
  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Leave existing org unit
  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Set the user(Wendy) to the Organization Unit

View workflow run

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Cypress E2E tests failed (5)

Branch: feature/aps-4674-self-issue-cred | Commit: be20401

Stats
suites           120
tests            919
passes           912
pending          2
failures         5
testsRegistered  919
passPercent      99.23830250272034
pendingPercent   0.2176278563656148
other            0
hasOther         false
skipped          0
hasSkipped       false
start            2026-08-07T20:08:35.719Z
end              2026-08-07T21:23:29.884Z
duration         4494165

Failed tests (5)

  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Navigate to Users Page
  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Search Wendy (Credential Issuer) from the user list
  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Navigate to Groups tab
  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Leave existing org unit
  • 14-org-assignment/04-multiple-org-admin-org-unit.ts - Set the user(Wendy) to the Organization Unit

View workflow run

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