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: introduces dymanic feature binding in WebService #4559

Merged

Conversation

wolf4ood
Copy link
Contributor

@wolf4ood wolf4ood commented Oct 17, 2024

What this PR changes/adds

Introduces dymanic feature binding in WebService for binding a JerseyJsonLdInterceptor for each controller in order to use the right JSON-LD scope.

Additionally the JsonLdRemoteMessageSerializerImpl uses the right scope based on the protocol version.

Why it does that

Briefly state why the change was necessary.

Further notes

List other areas of code that have changed but are not necessarily linked to the main feature. This could be method
signature changes, package declarations, bugs that were encountered and were fixed inline, etc.

Linked Issue(s)

Closes #4558

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

@wolf4ood wolf4ood self-assigned this Oct 17, 2024
@wolf4ood wolf4ood added enhancement New feature or request dataspace-protocol related to the dataspace protocol labels Oct 17, 2024
@wolf4ood wolf4ood force-pushed the refactor/4558_dsp_json_ld_configuration branch 3 times, most recently from 0533195 to aca1429 Compare October 18, 2024 09:08
@wolf4ood wolf4ood marked this pull request as ready for review October 18, 2024 10:30
@wolf4ood wolf4ood added the api Feature related to the (REST) api label Oct 18, 2024
@wolf4ood wolf4ood force-pushed the refactor/4558_dsp_json_ld_configuration branch from 997826a to 5ae3845 Compare October 18, 2024 11:34
@wolf4ood wolf4ood force-pushed the refactor/4558_dsp_json_ld_configuration branch from 5ae3845 to 01a82b3 Compare October 18, 2024 12:18
transformerRegistry.register(new JsonObjectFromProtocolVersionsTransformer());
transformerRegistry.register(new JsonObjectFromVersionsError(Json.createBuilderFactory(Map.of())));

webService.registerResource(ApiContext.PROTOCOL, new DspVersionApiController(requestHandler, service));
webService.registerDynamicResource(ApiContext.PROTOCOL, DspVersionApiController.class, new JerseyJsonLdInterceptor(jsonLd, jsonLdMapper, DSP_SCOPE_V_08));
Copy link
Member

Choose a reason for hiding this comment

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

version endpoint has been introduced in version 2024/1 so it should have the related namespace (as pointed from the documentation: https://docs.internationaldataspaces.org/ids-knowledgebase/dataspace-protocol/common-functionalities/common.protocol)

not sure on what should happen with the next version tho...

Copy link
Contributor Author

@wolf4ood wolf4ood Oct 18, 2024

Choose a reason for hiding this comment

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

The version endpoint actually cannot have a version and it should change in the future i think.
but we currently use 0.8 namespace for terms , that's why I binded it to 0.8

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we are ok to do the "breaking change" we can do it once we introduce 2024/1 as namespace

@wolf4ood wolf4ood requested a review from ndr-brt October 21, 2024 08:17
@wolf4ood wolf4ood merged commit 3fb8c2b into eclipse-edc:main Oct 21, 2024
21 checks passed
@wolf4ood wolf4ood deleted the refactor/4558_dsp_json_ld_configuration branch October 21, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Feature related to the (REST) api dataspace-protocol related to the dataspace protocol enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor DSP jsonLD configuration
2 participants