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: Initial implementation of Catena-X policies #477

Conversation

jimmarino
Copy link
Contributor

@jimmarino jimmarino commented Jun 13, 2023

WHAT

This PR provides an initial implementation of SSI policies per this specification and the Summary Credential.

FURTHER NOTES

The CX policy module contains functions for working with Json-Ld structures. These functions (JsonLdTypeFunctions and JsonLdValueFunctions) will likely be refactored into a common module and shared with the new SSI-based IdentityService in a subsequent PR.

Closes #476

@jimmarino jimmarino force-pushed the previews/preview_0_1_1_snapshot branch from c146d73 to e2a5fbf Compare June 14, 2023 08:01
@jimmarino jimmarino marked this pull request as ready for review June 14, 2023 08:08
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

* Converts the value to a string representation.
*/
@Nullable
private static String convertType(JsonValue value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

eventually we'll likely want to upstream these utilities

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I thinking we need separate set of Json-Ld utils.

/**
* Returns true if the actual operand value is a string literal case-insensitive equal to the expected value.
*/
protected boolean validateRightOperand(String expectedValue, Object actualValue, PolicyContext context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the expected value should be a vararg, because there could be several allowed ones, same as we have for the validateOperator

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 think the expected value should be a vararg, because there could be several allowed ones, same as we have for the validateOperator

Yeah, that method is going to actually have to be modified when we switch versions from the left to right operand as described here. I'll do that in another PR.

@paullatzelsperger paullatzelsperger merged commit 249bd8a into eclipse-tractusx:previews/preview_0_1_1_snapshot Jun 14, 2023
paullatzelsperger pushed a commit that referenced this pull request Jun 14, 2023
* Initial implementation of Catena-X policies

* Add header

* Fix checkstyle

* Fix typo

* Fix typo

* Add javadoc

* Add javadoc

* Switch token eval to a policy validator function
paullatzelsperger pushed a commit that referenced this pull request Jun 15, 2023
* Initial implementation of Catena-X policies

* Add header

* Fix checkstyle

* Fix typo

* Fix typo

* Add javadoc

* Add javadoc

* Switch token eval to a policy validator function
paullatzelsperger pushed a commit that referenced this pull request Jun 19, 2023
* Initial implementation of Catena-X policies

* Add header

* Fix checkstyle

* Fix typo

* Fix typo

* Add javadoc

* Add javadoc

* Switch token eval to a policy validator function
paullatzelsperger added a commit that referenced this pull request Jun 21, 2023
* feat: upgrade to 0.1.1-SNAPSHOT, fix resulting compile errors

* chore: fix tests (#479)

* feat: Initial implementation of Catena-X policies (#477)

* Initial implementation of Catena-X policies

* Add header

* Fix checkstyle

* Fix typo

* Fix typo

* Add javadoc

* Add javadoc

* Switch token eval to a policy validator function

* chore: fix tests (#481)

* feat(policy):  (#487)

* Cleanup namespaces, add extension class, implement summary constraint

* Update credential names; add rule bindings

* feat(SSI): implements the MIW client with Oauth2 as token provider for using the MIW APIs (#489)

* fix: version catalog

* feat(ParticipantIdentity): implements the ID extractor  (#504)

* feat(ParticipantIdentity): implements the ID extractor for the summary credential + E2E test

* feat(ParticipantIdentity): more tests and ID extractor exception if identity not extracted

* feat(ParticipantIdentity): add audience validation + tests

* fix after review

* remove short-term cache invalidation

---------

Co-authored-by: Enrico Risa <enrico.risa@gmail.com>
Co-authored-by: Jim Marino <jim.marino@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

3 participants