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(IATP): configurable trusted issuers #3603

Merged

Conversation

wolf4ood
Copy link
Contributor

What this PR changes/adds

Adds an extension for configuring the list of trusted issuer in the TrustedIssuerRegistry

Why it does that

iatp adoption

Linked Issue(s)

Closes #3602

@wolf4ood wolf4ood self-assigned this Nov 13, 2023
@wolf4ood wolf4ood added dcp enhancement New feature or request labels Nov 13, 2023
@wolf4ood wolf4ood force-pushed the feat/3602_configurable_trusted_issuers branch 2 times, most recently from 6ab7ba8 to 999b855 Compare November 13, 2023 16:20
@wolf4ood wolf4ood marked this pull request as ready for review November 13, 2023 16:40
@wolf4ood wolf4ood force-pushed the feat/3602_configurable_trusted_issuers branch from 999b855 to f5cefb1 Compare November 14, 2023 07:39
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.

Few minor questions/comments

@@ -0,0 +1,13 @@
# Trusted Issuer Configuration Extension
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get rid of this documentation and just use the annotations for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we support the prefix style in annotations?

var config = context.getConfig(CONFIG_PREFIX);
var issuers = config.partition().map(this::configureIssuer).toList();
if (issuers.isEmpty()) {
throw new EdcException("The list of trusted issuers is empty");
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this abort the runtime or just issue an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I though of just issuing an error message but then in theory it will not work anyway at runtime since the list is empty

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I thought though it may be "nicer" to not abort, but don't have a strong opinion.

@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (efb407e) 72.10% compared to head (dede26f) 72.08%.
Report is 1 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    #3603      +/-   ##
==========================================
- Coverage   72.10%   72.08%   -0.03%     
==========================================
  Files         897      899       +2     
  Lines       17919    17984      +65     
  Branches     1018     1023       +5     
==========================================
+ Hits        12920    12963      +43     
- Misses       4562     4580      +18     
- Partials      437      441       +4     

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

private Issuer configureIssuer(Config config) {

var id = config.getString(ID_SUFFIX);
var propertiesConfig = config.getString(PROPERTIES_SUFFIX, "{}");
Copy link
Member

Choose a reason for hiding this comment

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

alternatively, pass null as default value, and instantiate Issuer(id, Map.or()) if the propertiesConfig is null. saves us a call to the typemanager and makes the code a bit more explicit.

@wolf4ood wolf4ood merged commit 72a522a into eclipse-edc:main Nov 14, 2023
17 checks passed
tuncaytunc-zf pushed a commit to tuncaytunc-zf/DataSpaceConnector that referenced this pull request Nov 15, 2023
* feat(IATP): configurable trusted issuers

* pr remarks
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.

IATP: configurable trusted issuers
4 participants