Credential status check queries the status list before the expiry check, so expired credentials can end in ERROR

Open
#1,282 4 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@paullatzelsperger is already working on this.

Since Nov 25, 2026.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java

Research direction

Start in CredentialStatusCheckServiceImpl.checkStatus (core/identity-hub-core) and follow the order: superseded, status list lookup, then expiry. Read CredentialWatchdog.determineStatus and its ALLOWED_STATES/Javadoc to see how a failed check becomes ERROR and why expired credentials are re-checked each period. The tests checkStatus_expired_becomesRevoked/checkStatus_expired_becomesSuspended (CredentialStatusCheckServiceImplTest.java L268-296) pin the current precedence, so run them first. Done means an expired, non-revoked credential reaches EXPIRED without a status list lookup while revoked-after-expiry still reports REVOKED, with tests updated to match — but the approach is still an open choice for maintainers, so confirm which option they want before editing.

Written by the indexing model from the issue text.

Description

triage

Bug Report

Describe the Bug

CredentialStatusCheckServiceImpl.checkStatus resolves the status list of a credential before it checks the expiration date. The order is: superseded, then the status list lookup (REVOKED, SUSPENDED), then expiry.

As a result, an expired credential still causes a status list lookup. When the status list is not reachable, the credential moves to ERROR instead of EXPIRED.

Expected Behavior

An expired credential that is not revoked moves to EXPIRED and stays there, even when its status list is not reachable. It does not need a network lookup on each watchdog run.

Observed Behavior
  1. An expired credential still triggers a status list lookup. The unit tests checkStatus_expired_becomesRevoked and checkStatus_expired_becomesSuspended assert this (CredentialStatusCheckServiceImplTest.java#L268-L296).
  2. When the status list lookup fails, checkStatus returns a failure, and CredentialWatchdog.determineStatus maps it to ERROR (CredentialWatchdog.java#L188-L193). The credential is expired, but its state is ERROR.
  3. CredentialWatchdog.ALLOWED_STATES includes EXPIRED (CredentialWatchdog.java#L76), but the class Javadoc says the watchdog fetches "all non-expired, non-revoked credentials" (L55). So an expired credential that is not superseded is checked again on every watchdog run (edc.iam.credential.status.check.period, default 60 s), with a new status list lookup each time. The extra lookup is a recurring cost, not a one-time cost.

Steps to Reproduce

  1. Store a holder credential with a status list entry and an expirationDate in the past. Do not supersede it with a renewed credential.
  2. Make the status list URL unreachable.
  3. Let the credential watchdog run.
  4. The credential moves to ERROR, and the log shows "Error determining status for credential ...". It does not move to EXPIRED.
  5. With the status list reachable, the watchdog fetches the status list for this expired credential on every run.

Context Information

  • Used version: IdentityHub v1.0.0-RC7. The check order is the same on main (checked 2026-11-20).
  • OS: not relevant

Detailed Description

The check order is in CredentialStatusCheckServiceImpl.java#L48-L71:

if (credential.isSuperseded()) {
    return success(VcStatus.EXPIRED);
}
Set<String> statusPurposes;
try {
    statusPurposes = fetchStatusPurposes(credential);
} catch (EdcException ex) {
    return failure(ex.getMessage());
}
if (statusPurposes.contains(REVOCATION)) {
    return success(VcStatus.REVOKED); //irreversible, cannot be overwritten
}
if (statusPurposes.contains(SUSPENSION)) {
    return success(VcStatus.SUSPENDED);
}
if (isExpired(credential)) {
    return success(VcStatus.EXPIRED);
}

We understand that REVOKED takes precedence on purpose: a revoked credential must show as REVOKED even after it expires, and the tests above confirm this design. This report does not ask to drop that rule. It asks how the cost and the ERROR outcome for expired credentials can be avoided while the rule stays.

Related: #1173 / #1174 fixed the same order problem for superseded credentials: the superseded check now runs before the status list lookup, so a superseded credential stays EXPIRED even when its status list cannot be fetched. Credentials that expired by date but were not superseded still go through the status list lookup first. This issue is about that remaining case.

Also related: #1100 (transient status list failure moved credentials to ERROR permanently).

Possible Implementation

We leave the choice to the maintainers. Some options:

  • Check expiry before the status list lookup. This changes the REVOKED-after-expiry outcome, so it may need an exception for credentials that were not yet checked after expiry.
  • Keep the order, but on a failed status list lookup for an expired credential, return EXPIRED instead of a failure.
  • Skip the status check for credentials already in EXPIRED (as the Javadoc already says), so the watchdog checks an expired credential once, not on every run. We did not check whether other watchdog steps, for example renewal, need EXPIRED in ALLOWED_STATES.
  • Add a retention setting after which expired credentials are no longer checked.
Dominant language
Java
Stars
46
Forks
65
Avg merge
1d 5h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-edc/IdentityHub

All issues in eclipse-edc/IdentityHub

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.