Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: embedded STS #3529

Merged
merged 4 commits into from Oct 13, 2023
Merged

Conversation

wolf4ood
Copy link
Contributor

@wolf4ood wolf4ood commented Oct 10, 2023

What this PR changes/adds

Implements STS (Secure Token Service) embedded

TheEmbeddesSecureTokenService creates the Self-Issued ID token from the input claims by using a TokenGenerationService. If the param bearerAccessScope is provide it will also automatically attach the access_token claim which is another Jwt token containing the provided scopes (Credential Service Access).

The Self-Issued ID format is compliant with the spec here.

For the access_token the format is still a JWT similar to the Self-Issued ID one but the:

  • scope claim that contains the bearerAccessScope for the Credential Service access.
  • iss claim is the same as the Self-Issued
  • aud is the iss of the Self-Issued token
  • sub is the aud of the Self-Issued token

The the same private key it's used for signing the Self-Issued ID token and the Access token.

Why it does that

IATP adoption

Further notes

The ConsumerPullKeyPairFactory as been refactored by extracting the KeyPairFactory spi and moving KeyPairFactoryImpl into connector-core, so it can be reused by the iatp and TransferDataPlaneCoreExtension.

Linked Issue(s)

Closes #3500

@wolf4ood wolf4ood self-assigned this Oct 10, 2023
@wolf4ood wolf4ood added enhancement New feature or request core feature iatp labels Oct 10, 2023
@bscholtes1A bscholtes1A self-requested a review October 11, 2023 07:38
@wolf4ood wolf4ood force-pushed the feat/3500_sts_embedded branch 2 times, most recently from 572482c to fe96ce6 Compare October 11, 2023 10:25
@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2023

Codecov Report

Attention: 45 lines in your changes are missing coverage. Please review.

Comparison is base (5759cc8) 72.21% compared to head (fcb541a) 72.31%.
Report is 2 commits behind head on main.

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3529      +/-   ##
==========================================
+ Coverage   72.21%   72.31%   +0.10%     
==========================================
  Files         853      864      +11     
  Lines       17162    17355     +193     
  Branches      965      987      +22     
==========================================
+ Hits        12394    12551     +157     
- Misses       4359     4393      +34     
- Partials      409      411       +2     
Files Coverage Δ
...ipse/edc/connector/core/CoreServicesExtension.java 94.59% <100.00%> (+0.15%) ⬆️
...identitytrust/validation/rules/HasValidIssuer.java 100.00% <100.00%> (ø)
...titytrust/validation/rules/HasValidSubjectIds.java 100.00% <100.00%> (ø)
.../iam/identitytrust/validation/rules/IsRevoked.java 100.00% <100.00%> (ø)
...trust/sts/embedded/EmbeddedSecureTokenService.java 100.00% <100.00%> (ø)
...tytrust/sts/embedded/SelfIssuedTokenDecorator.java 100.00% <100.00%> (ø)
...o/JsonObjectToVerifiableCredentialTransformer.java 90.00% <100.00%> (ø)
...sfer/dataplane/TransferDataPlaneCoreExtension.java 81.81% <ø> (+7.90%) ⬆️
.../edc/identitytrust/model/VerifiableCredential.java 50.00% <ø> (ø)
...dc/identitytrust/model/VerifiablePresentation.java 58.62% <100.00%> (ø)
... and 12 more

... and 2 files with indirect coverage changes

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

@wolf4ood wolf4ood force-pushed the feat/3500_sts_embedded branch 12 times, most recently from e052410 to c143498 Compare October 12, 2023 10:40
Copy link
Member

@paullatzelsperger paullatzelsperger left a comment

Choose a reason for hiding this comment

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

LGTM, mostly minor nits

Copy link
Contributor

@jimmarino jimmarino left a comment

Choose a reason for hiding this comment

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

Two small changes in the comments.

wolf4ood and others added 2 commits October 13, 2023 15:50
…/KeyPairFactory.java

Co-authored-by: Jim Marino <jim.marino@gmail.com>
…ain/java/org/eclipse/edc/iam/identitytrust/core/IatpDefaultServicesExtension.java

Co-authored-by: Jim Marino <jim.marino@gmail.com>
@wolf4ood wolf4ood merged commit 7876288 into eclipse-edc:main Oct 13, 2023
17 checks passed
@wolf4ood wolf4ood deleted the feat/3500_sts_embedded branch October 13, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IATP: implement embedded STS
5 participants