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: additional policy scopes #1699

Merged

Conversation

ronjaquensel
Copy link
Contributor

@ronjaquensel ronjaquensel commented Jul 15, 2022

What this PR changes/adds

It introduces two new policy scopes. The first one is contract.cataloging, which is used during the cataloging phase. The previously existing scope contract.negotiation is now used during the negotiation itself and to re-evaluate the policies before a new transfer process is created. The other new scope is provision.manifest.verify, which is used to evaluate a generated ResourceManifest to ensure that it fulfils the given policy.

Why it does that

Currently, policy evaluation only takes place during the negotiation phase.

Further notes

Introduces the possibility to pass additional context information to the PolicyEngine, which is available to evaluation functions via the PolicyContext. This is required to pass information about the ResourceManifest to the functions.

Linked Issue(s)

Closes #1446
Closes #1331

Checklist

  • added appropriate tests?
  • performed checkstyle check locally?
  • added/updated copyright headers?
  • documented public classes/methods?
  • added/updated relevant documentation?
  • added relevant details to the changelog? (skip with label no-changelog)
  • formatted title correctly? (take a look at the CONTRIBUTING and styleguide for details)

@ronjaquensel ronjaquensel added enhancement New feature or request policy labels Jul 15, 2022
@ronjaquensel ronjaquensel requested review from juliapampus and removed request for ndr-brt and paullatzelsperger July 15, 2022 14:13
@codecov-commenter
Copy link

Codecov Report

Merging #1699 (bcd6062) into main (ad1f3e8) will decrease coverage by 0.03%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##             main    #1699      +/-   ##
==========================================
- Coverage   67.85%   67.81%   -0.04%     
==========================================
  Files         782      785       +3     
  Lines       16759    16843      +84     
  Branches     1064     1068       +4     
==========================================
+ Hits        11371    11422      +51     
- Misses       4918     4950      +32     
- Partials      470      471       +1     
Impacted Files Coverage Δ
...connector/transfer/core/CoreTransferExtension.java 0.00% <0.00%> (ø)
...pi/transfer/provision/ResourceManifestContext.java 0.00% <0.00%> (ø)
...econnector/core/base/policy/PolicyContextImpl.java 46.15% <25.00%> (-9.41%) ⬇️
...ract/validation/ContractValidationServiceImpl.java 54.54% <35.00%> (-7.00%) ⬇️
...ceconnector/core/base/policy/PolicyEngineImpl.java 78.26% <60.00%> (-3.10%) ⬇️
...ceconnector/contract/ContractServiceExtension.java 95.71% <100.00%> (ø)
.../contract/offer/ContractDefinitionServiceImpl.java 100.00% <100.00%> (ø)
.../core/provision/ResourceManifestGeneratorImpl.java 100.00% <100.00%> (ø)
...sfer/core/transfer/TransferProcessManagerImpl.java 82.75% <100.00%> (+0.40%) ⬆️
...onnector/spi/security/VaultPrivateKeyResolver.java 66.66% <0.00%> (-15.16%) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad1f3e8...bcd6062. Read the comment docs.

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.

Great stuff!

@ronjaquensel ronjaquensel force-pushed the feature/1446-policy-scopes-2 branch from fdce93a to b3bb23f Compare July 20, 2022 06:15
@ronjaquensel ronjaquensel merged commit 2addc6b into eclipse-edc:main Jul 20, 2022
@ronjaquensel ronjaquensel deleted the feature/1446-policy-scopes-2 branch July 20, 2022 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request policy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Policy enforcement: definition of policy scopes Contract policy evaluated during catalog request
3 participants