Add a little logic to CORS config processing and significantly update the CORS doc #8212
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.
Description
Resolves #8026
The change in 4.x in how built-in features such as metrics and health are automatically discovered and activated did not revise the CORS doc so the descriptions particularly for how to control the CORS behavior for those features had fallen out of step with how Helidon behaves.
Also, because these services no longer require explicit developer code to add them to an SE web server, we needed to allow CORS to rely on configuration to establish the settings for those services.
This PR contains two important changes:
It adds logic to the CORS
Aggregator
to allow the user to set up CORS behavior for any endpoint--including the built-in services--using only configuration.(The role of the
Aggregator
in CORS has always been to pull together the CORS set-up from multiple places: explicitly codedCorsSupport
instances, config, and MP annotations.)It significantly updates the CORS-related doc:
CorsSupport
instances and included it them in the routing for their services or endpoints.Documentation
The PR includes doc updates.