-
Notifications
You must be signed in to change notification settings - Fork 161
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
Dynamic CORS Filter #3278
Merged
Coduz
merged 2 commits into
eclipse-kapua:develop
from
lorthirk:feature-corsOriginRegistry
Apr 13, 2021
Merged
Dynamic CORS Filter #3278
Coduz
merged 2 commits into
eclipse-kapua:develop
from
lorthirk:feature-corsOriginRegistry
Apr 13, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lorthirk
added
Console GWT
This issue/PR is related to Admin Web Console
Enhancement
This PR/Issue improves an part of Kapua
REST API
We hope to REST everyday
labels
Mar 17, 2021
Codecov Report
@@ Coverage Diff @@
## develop #3278 +/- ##
=============================================
+ Coverage 52.71% 54.10% +1.39%
- Complexity 782 786 +4
=============================================
Files 1470 1475 +5
Lines 30031 30150 +119
Branches 2508 2520 +12
=============================================
+ Hits 15832 16314 +482
+ Misses 13306 12920 -386
- Partials 893 916 +23
|
lorthirk
force-pushed
the
feature-corsOriginRegistry
branch
7 times, most recently
from
March 24, 2021 18:06
e624c31
to
c2dfad0
Compare
lorthirk
force-pushed
the
feature-corsOriginRegistry
branch
3 times, most recently
from
March 25, 2021 17:06
ecb501c
to
f8b0499
Compare
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
lorthirk
force-pushed
the
feature-corsOriginRegistry
branch
from
March 25, 2021 22:03
f8b0499
to
4b18a33
Compare
Coduz
approved these changes
Apr 13, 2021
This was referenced Apr 14, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Console GWT
This issue/PR is related to Admin Web Console
Enhancement
This PR/Issue improves an part of Kapua
REST API
We hope to REST everyday
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing Dynamic CORS Filter
This is a refactoring of the existing CORS filter, that is currently allowing all Cross Origins requests responding with
Access-Control-Allow-Origin: *
to any REST request. From now on, the CORS Filter will only allow calls from specific Origins that can be configured per-account or for the whole system.Related Issue
No related issues
Description of the solution adopted
The filter leverages the Endpoints feature to register allowed Origins for any given account.
A new tab will appear under the Settings menu item, named CORS. Here you can add HTTP Origins that will be allowed for a given account. Since those items are actually leveraging the Endpoints feature, the same inheritance rules will apply (i.e. if not CORS Origins are found in a given account, the account hierarchy will be traversed up until the root account until a CORS Origin definition will be found).
System-wide CORS Origins can also be configured via the
api.cors.origins.allow
system property.Screenshots
New Add Endpoint Dialog:
Any side note on the changes made
The Endpoints registered as valid CORS Origins will have the
cors
Endpoint Type. Regular Endpoints will have theresource
Endpoint Type.