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(api): enable authentication for control-api #4197

Merged

Conversation

ndr-brt
Copy link
Member

@ndr-brt ndr-brt commented May 20, 2024

What this PR changes/adds

Permit control-api authentication via extensions.

Server side:

  • a ApiAuthenticationRegistry service has been introduced that can be used both for management-api and control-api, it is used to register an AuthenticationService for the specified context.

Client side:

  • the ControlClientAuthenticationProvider can be registered to provide the authentication headers. It has already been injected on all the "control-api client" services to decorate the request with the headers (by default it returns an empty map)

Why it does that

authentication

Further notes

  • currently the contexts name are defined as control-api, management-api, ... as done for the transformers, but, the context alias as it is handled by the configuration is in the form of control, management. It would be better to uniform to a single convention, and the latter would be preferred. Subsequent PR will come

Linked Issue(s)

Closes #839

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

@ndr-brt ndr-brt added enhancement New feature or request api Feature related to the (REST) api labels May 20, 2024
@ndr-brt ndr-brt requested a review from wolf4ood May 20, 2024 10:29
@codecov-commenter
Copy link

codecov-commenter commented May 20, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 75.42%. Comparing base (7f20ba5) to head (f548e96).
Report is 268 commits behind head on main.

Files Patch % Lines
...plane/selector/RemoteDataPlaneSelectorService.java 72.72% 3 Missing ⚠️
...lipse/edc/api/ApiCoreDefaultServicesExtension.java 0.00% 1 Missing ⚠️
...onfiguration/ControlApiConfigurationExtension.java 75.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4197      +/-   ##
==========================================
+ Coverage   71.74%   75.42%   +3.68%     
==========================================
  Files         919     1012      +93     
  Lines       18457    20558    +2101     
  Branches     1037     1153     +116     
==========================================
+ Hits        13242    15506    +2264     
+ Misses       4756     4542     -214     
- Partials      459      510      +51     

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

@ndr-brt ndr-brt force-pushed the 839-control-api-authentication branch 2 times, most recently from 6bf2c7f to 877ab5f Compare May 20, 2024 12:02
@ndr-brt ndr-brt force-pushed the 839-control-api-authentication branch from 877ab5f to 84a941a Compare May 20, 2024 12:14
@ndr-brt ndr-brt merged commit b39e532 into eclipse-edc:main May 22, 2024
16 checks passed
@ndr-brt ndr-brt deleted the 839-control-api-authentication branch May 22, 2024 12:36
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 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API Security: enable authentication for (internal) REST APIs
3 participants