8000 [OID4VCI] Add REST endpoints to revoke all issued credentials for a user by forkimenjeckayang · Pull Request #53645 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

[OID4VCI] Add REST endpoints to revoke all issued credentials for a user - #53645

Open
forkimenjeckayang wants to merge 2 commits into
keycloak:mainfrom
adorsys:issue-49816
Open

forkimenjeckayang wants to merge 2 commits into
keycloak:mainfrom
adorsys:issue-49816

Conversation

@forkimenjeckayang
Copy link
Copy Markdown
Contributor

Description

Adds admin and account REST endpoints for revoking all issued verifiable credential records belonging to a user.

New endpoints

  • Admin REST:
    DELETE /admin/realms/{realm}/users/{userId}/vc/issued-credentials
  • Account REST:
    DELETE /realms/{realm}/account/issued-verifiable-credentials

Both endpoints return 204 No Content and are idempotent when the user has no issued credential records.

Implementation

  • Adds a dedicated removeIssuedVerifiableCredentials model operation.
  • Uses the existing bulk JPA deletion queries instead of deleting records individually.
  • Supports both local and federated users.
  • Enforces user-management permissions on the admin endpoint.
  • Enforces manage-account or manage-verifiable-credentials on the account endpoint.
  • Adds Java and JavaScript admin-client methods.
  • Reuses the bulk operation in existing user-deletion cleanup paths.

Cache integration

This change is based on the current main branch, where issued credential records are not yet cached. Once #53332 is merged, the bulk operation will need to invalidate the affected user's issued-credential cache entry and include cluster-aware cache invalidation coverage.

Closes #49816

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

The destructive cross-storage operation and pending cache-invalidation integration warrant final human review.

Review effort: Balanced
Findings: None

What changed in this PR

Adds admin and account endpoints to bulk-revoke a user’s issued verifiable credential records.

Changes:

  • Adds authorized bulk-revocation REST endpoints and admin-client methods.
  • Implements efficient local and federated JPA bulk deletion.
  • Adds coverage for isolation, idempotency, authorization, and federated users.
File Description
tests/​base/​.../​IssuedVerifiableCredentialTest.java Tests the admin endpoint.
tests/​base/​.../​FederatedIssuedVerifiableCredentialTest.java Tests federated bulk deletion.
tests/​base/​.../​AccountRestServiceRolesTest.java Tests account endpoint behavior and authorization.
services/​.../​AccountIssuedVerifiableCredentialResource.java Adds the account endpoint.
services/​.../​UserVerifiableCredentialResource.java Adds the admin endpoint and event.
server-spi/​.../​UserProvider.java Defines the bulk-removal operation.
model/​storage/​.../​UserVerifiableCredentialFederatedStorage.java Extends federated storage API.
model/​storage-private/​.../​UserStorageManager.java Routes removal by storage type.
model/​jpa/​.../​JpaUserFederatedStorageProvider.java Implements federated bulk deletion.
model/​jpa/​.../​JpaUserProvider.java Implements local bulk deletion and reuses it during cleanup.
model/​infinispan/​.../​UserCacheSession.java Delegates the new model operation.
js/​libs/​.../​users.ts Adds the JavaScript admin-client method.
integration/​admin-client-core/​.../​UserVerifiableCredentialResource.java Adds the Java admin-client method.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 08:40
Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The endpoints, storage routing, bulk deletion, permissions, and relevant tests are consistent and complete.

Review effort: Balanced
Findings: None

Copilot AI balanced review requested due to automatic review settings October 7, 2026 10:50
Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The endpoints, storage routing, bulk deletion, permissions, and relevant local and federated behavior are implemented consistently and covered by tests.

Review effort: Balanced
Findings: None

Copilot AI balanced review requested due to automatic review settings October 7, 2026 11:38
Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The endpoints, storage implementations, permissions, and key bulk-deletion behaviors are consistently implemented and covered by tests.

Review effort: Balanced
Findings: None

Copilot AI balanced review requested due to automatic review settings October 7, 2026 12:52
Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The account endpoint’s alternative manage-verifiable-credentials authorization path lacks positive test coverage.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Copilot AI balanced review requested due to automatic review settings October 7, 2026 13:06
Copilot AI 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.

Copilot review overview

🟡 Changes recommended

A new test leaks shared credential state, and the public endpoints are missing from the existing OID4VCI documentation.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings October 7, 2026 13:14
Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The endpoints, storage implementations, authorization, documentation, and relevant test coverage are consistent and complete.

Review effort: Balanced
Findings: None

Resolved since last review (2)

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

code LGTM, just something on the doc

Copilot AI balanced review requested due to automatic review settings November 26, 2026 08:21
Copilot AI 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.

🟢 Approval recommended

No active review issues block the user credential bulk-revocation change.

No open issues 🎉

Review effort: Balanced

Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 09:13
Copilot AI 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.

🟢 Approval recommended

No active review issues were identified for the bulk credential revocation change.

No open issues 🎉

Review effort: Balanced

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.

[OID4VCI] Ability to revoke issued credentials of the user - REST

3 participants

0