Remove connector-level CORS configuration (breaking change)#9
Merged
Conversation
Removes the :allowed-origins configuration option and the with-default-interceptors call that configured CORS at the service component level. CORS and other default request interceptors must now be configured per-route in the consuming application. Changes: - Remove allow-all-origins var and allowed-origins function - Remove with-default-interceptors call from service initialization - Update README with new Interceptors section explaining options - Remove CORS integration tests that test removed functionality - Version bump: 0.3.8 → 0.4.0 (breaking change) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Removes the
:allowed-originsconfiguration option and thewith-default-interceptorscall that configured CORS at the service component level. CORS and other default request interceptors must now be configured per-route in the consuming application using Pedestal's built-in mechanisms.Motivation
This change decouples CORS policy and interceptor configuration from the service component, moving these concerns to the consuming application where they belong. Each application should decide which routes require CORS, authentication, rate limiting, or other interceptors.
Breaking Changes
:allowed-originsconfiguration option is no longer supportedwith-default-interceptorsio.pedestal.connector/with-default-interceptorsin route setup, orChanges
src/service/component.cljallow-all-originsvarallowed-originsprivate functionallowed-origins'binding andwith-default-interceptorscallREADME.md:allowed-originsfrom configuration table:allowed-originsexample and noteVersion bump:
0.3.8→0.4.0project.cljandpom.xmlCHANGELOG.mdTests
test/integration/cors_test.clj(tested removed functionality)Test Plan
Existing tests pass (pre-existing failures in other test suites are unrelated to these changes). The CORS-related tests were removed as they tested functionality no longer provided by this component.
To verify: consuming applications using this component must migrate to per-route CORS configuration.
🤖 Generated with Claude Code