Repository navigation
Conversation
Contributor
Author
Code review summary (xhigh, two rounds + fix check)Round 1 (9891b46): 13 findings, all fixed in a6353c4
Round 2 (a6353c4): 9 findings, all fixed in 2209f4b
Not yet done: a full bug review of 2209f4b itself beyond confirming these fixes. Remote Maven CI is still pending. |
|
Contributor
Author
Follow-up check of da162fd (Sonar cleanup)I didn't find any new issues; the changes look behavior-preserving:
Scope: I read the main-source diff only and didn't rerun tests locally. Maven CI is still pending. networknt/light-lambda-native#196 still needs this PR merged and a framework snapshot published before its CI can pass. |
This branch has not been deployed
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
Support scoped CORS origins such as
https://*.example.comthrough the compiledcors-configpolicy and Undertow handler. Patterns match complete subdomain labels at every depth, exclude the apex, and match scheme and normalized port. Reject unrestricted/partial wildcards, public/private PSL suffixes, unknown suffixes, and malformed origins.enabledkey remains disabled; the packaged YAML explicitly enables CORS.OriginintoVaryat response commit so backend cache keys survive NetworkNT proxy header copying.matchOriginhelper stateless and exact-only, with its original configured-string/server-origin return contract. Raw wildcard entries do not opt callers into wider trust; this helper does no compilation or PSL lookup. Its handler argument remains for compatibility and is ignored.cors/README.mdwith policy semantics, runtime consumer requirements, trust boundaries, and verification steps.Consumer coordination
Lambda companion: networknt/light-lambda-native#196 (draft). It migrates request/preflight matching to
CorsConfig.policyForPath(path).origins().matches(origin)and carries the validated origin/method snapshot into response handling, preserving backend Vary values.Consumers that still compare
getAllowedOrigins()/getPathPrefixAllowed()strings do not implement wildcard matching. Lambda must upgrade both middleware and the framework artifact. The companion was qualified locally against core commit 2209f4b, but remains draft until this API is available in the framework artifact. No artifacts were published and no CI source pins/workflows were changed.Compatibility decisions
nullopt-in. Wildcards remain HTTP/HTTPS-only and strict DNS patterns; underscores, trailing dots, custom schemes, and opaquenullcannot match them.Re-review findings
allowedOrigins.The earlier proxy-cache, concurrency, per-path isolation, disabled-startup, validation-type, dependency-management, and public port-utility findings remain covered.
sanitizeDefaultPortstays as a deprecated adapter to the shared parser rather than removing a public API.Validation
mvn -o -pl cors-config,cors -am test -Dtest='Cors*Test,ProxyHandlerSseTest' -Dsurefire.failIfNoSpecifiedTests=false -Dcors.browserSmoke=truemvn -o test). No AWS deployment/invocation or GraalVM native-image qualification was performed.http://[fe80::1%eth0]on CI but rejected it locally; zone identifiers are now rejected explicitly before literal parsing. Also synchronizedisEnabledwith its setter to address the remaining earlier-head Sonar reliability finding.git diff --checkpassed. GitNexus pre-edit impact, staged diff and comparison with master completed. Core diff risk was LOW; Lambda companion diff was HIGH across request/preflight/response flows, reviewed against the refreshed graph and full JVM suite.CorsConfig.PolicyandpolicyForPath. Local coordinated-source success does not establish published/native/deployed qualification.Closes #2841.
Sonar cleanup qualification
Commit
da162fdaddresses the 22 remaining Sonar findings. Fresh Sonar analysisfef9fa0b-46dc-4f3e-80f2-e85de2e3bca2reports 0 unresolved issues and Quality Gate OK; both GitHub Sonar checks and pre-commit passed for this head. Maven CI is still running.The cleanup uses unnamed catch variables, single-operation exception-test lambdas, an equivalent description text block, and switch-based list parsing. Absent-field legacy null getters are preserved and explicitly covered; schema/YAML regeneration produced no diff. Focused tests and the opt-in Chromium smoke passed.
Four narrowly scoped exemptions preserve intentional compatibility/conventions: three S1133 reminders on retained deprecated public APIs, and S1845 on the established enabled/ENABLED backing-field/key convention. Deprecation replacements,
since/forRemovalmetadata, and reasons are documented in source. No global rule exclusions or public API removals were introduced.