-
Notifications
You must be signed in to change notification settings - Fork 117
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
Allow configuring CORS origins in config file #811
Conversation
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #811 +/- ##
============================================
- Coverage 65.71% 65.61% -0.11%
- Complexity 3289 3319 +30
============================================
Files 350 355 +5
Lines 13731 13852 +121
Branches 1488 1498 +10
============================================
+ Hits 9024 9089 +65
- Misses 3863 3917 +54
- Partials 844 846 +2
... and 12 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/com/linecorp/centraldogma/server/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
72ee254
to
99e21e4
Compare
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'm guessing with the next iteration of reviews this PR should be good for merging 👍
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogmaBuilder.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogmaConfig.java
Outdated
Show resolved
Hide resolved
- allow using a string or an array of strings to specify cors allowed origins - fix code style - use assertJ in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good. Left only minor comments.
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CorsConfig.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CorsConfig.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CorsConfig.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogmaBuilder.java
Outdated
Show resolved
Hide resolved
server/src/test/java/com/linecorp/centraldogma/server/CentralDogmaConfigTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/com/linecorp/centraldogma/server/CentralDogmaConfigTest.java
Outdated
Show resolved
Hide resolved
- don't allow unpositive maxAge - fix doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @baont! 🚀💯
Left a minor comment.
server/src/main/java/com/linecorp/centraldogma/server/CorsConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be my last review. Looking really nice 👍 Left only nit comments 🙇
server/src/main/java/com/linecorp/centraldogma/server/CorsConfig.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CorsConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience @baont ! Looks good to me 👍 🚀 💯
server/src/main/java/com/linecorp/centraldogma/server/CentralDogmaBuilder.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/linecorp/centraldogma/server/CentralDogmaBuilder.java
Outdated
Show resolved
Hide resolved
Co-authored-by: jrhee17 <guins_j@guins.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work, @baont! 🙇
server/src/main/java/com/linecorp/centraldogma/server/CentralDogma.java
Outdated
Show resolved
Hide resolved
gentle ping @minwoox 😄 |
gentle ping @minwoox 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the late review. Thanks a lot for adding this configuration! 😄
it/src/test/java/com/linecorp/centraldogma/it/CorsPolicyTest.java
Outdated
Show resolved
Hide resolved
Thanks a lot, @baont! 🎉 🎉 🎉 |
This is my implementation for the issue #754.
Motivation
Provide a way to configure CORS policies, so that web applications hosted in a different origin can call Central Dogma REST API.
Modifications
corsAllowedOrigins
toCentralDogmaConfig
Result: