feat: track credential state in DB #344
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR changes/adds
This PR removes the following states to a
VerifiableCredentialResource
:REISSUE_REQUESTING
REISSUE_REQUESTED
TERMINATED
and in their place adds the following ones:
EXPIRED
: when the credential has passed itsexpirationDate
(if present). Non-reversible.REVOKED
: when the credential is marked as"revoked"
by the status list credential.SUSPENDED
: when the credential is marked as"suspended"
by the status list credentialNOT_YET_VALID
: when the credentialsissuanceDate
is in the future.Credentials marked as
EXPIRED
orREVOKED
will be filtered out at the database layer, as their status can not change anymore.All other credentials are filtered down on egress by the
CredentialQueryResolver
, as their status could have changed meanwhile.Why it does that
The Presentation API should never return "invalid" (expired, suspended...) credentials.
Further notes
Note that this does not directly affect the Credential Management API
Linked Issue(s)
Closes #339
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.