Skip to content

Conversation

@paullatzelsperger
Copy link
Member

@paullatzelsperger paullatzelsperger commented Aug 21, 2024

What this PR changes/adds

This PR Adds support for BitStringStatusList revocation lists.

Why it does that

StatusList2021 was deprecated, and the spec group recommends the use of BitStringStatusList

Further notes

  • a registry was introduced to dispatch to revocation services based on the credentialStatus.type field
  • if no revocation service was registered for a particular credentialStatus.type, the credential is deemed valid (but a warning is logged)
  • if a credential does not contain a credentialStatus entry, the credential is deemed valid

Limitations

  • In this first iteration, only a statusSize of 1 is supported. Technically, this fulfills conformance requirements and can be improved in future iterations. Note that supporting other status sizes will require a re-engineering of our BitString implementation!

Linked Issue(s)

Closes #4357

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

public Duration ttl() {
var ttl = ofNullable(credentialSubject.get(0).getClaim(BITSTRING_STATUS_LIST_PREFIX, BITSTRING_TTL_LITERAL))
.map(String::valueOf)
.map(Long::parseLong)

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.

instance.statusListIndex = ofNullable(status.getProperty(BITSTRING_STATUS_LIST_PREFIX, BITSTRING_STATUS_LIST_INDEX_LITERAL))
.map(Object::toString)
.map(Integer::parseInt)

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.

var size = ofNullable(status.getProperty(BITSTRING_STATUS_LIST_PREFIX, STATUS_LIST_SIZE))
.map(Object::toString)
.map(Integer::parseInt);

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 84.01826% with 35 lines in your changes missing coverage. Please review.

Project coverage is 75.03%. Comparing base (7f20ba5) to head (d97b674).
Report is 393 commits behind head on main.

Files Patch % Lines
...itstring/BitstringStatusListRevocationService.java 82.05% 4 Missing and 3 partials ⚠️
...dentials/revocation/BaseRevocationListService.java 81.25% 4 Missing and 2 partials ⚠️
...tringstatuslist/BitstringStatusListCredential.java 84.21% 3 Missing and 3 partials ⚠️
...bitstringstatuslist/BitstringStatusListStatus.java 89.13% 3 Missing and 2 partials ⚠️
.../identitytrust/core/IdentityAndTrustExtension.java 0.00% 3 Missing ⚠️
...redentials/RevocationServiceRegistryExtension.java 0.00% 3 Missing ⚠️
...tatuslist2021/StatusList2021RevocationService.java 90.90% 1 Missing and 1 partial ⚠️
.../revocation/bitstringstatuslist/StatusMessage.java 50.00% 1 Missing and 1 partial ⚠️
...ation/statuslist2021/StatusList2021Credential.java 50.00% 0 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4427      +/-   ##
==========================================
+ Coverage   71.74%   75.03%   +3.29%     
==========================================
  Files         919     1082     +163     
  Lines       18457    21628    +3171     
  Branches     1037     1193     +156     
==========================================
+ Hits        13242    16229    +2987     
- Misses       4756     4871     +115     
- Partials      459      528      +69     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paullatzelsperger paullatzelsperger marked this pull request as ready for review August 22, 2024 08:41
@paullatzelsperger paullatzelsperger merged commit a9520c2 into eclipse-edc:main Aug 22, 2024
@paullatzelsperger paullatzelsperger deleted the feat/4357_add_bitstring_statuslist branch August 22, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dcp enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for BitStringStatusList

4 participants