fix(config): require explicit Config Server repository authority - #322
fix(config): require explicit Config Server repository authority#322seonghobae wants to merge 4 commits into
Conversation
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
There was a problem hiding this comment.
Do not merge #322 at 50ddcc0.
The YAML one-liner correctly removes https://github.com/your-repo/config-repo.git. That is the right destination-authority change. The new tests do not prove fail-closed startup.
ConfigServerRepositoryAuthorityLiveTest only reads application.yml and duplicates ConfigServerRepositoryConfigurationTest. Spring Cloud Config 5.0.4 still starts when CONFIG_REPO_URI is blank because JGitEnvironmentRepository checks uri != null and cloneOnStart defaults to false. A buyer who ships a blank secret therefore gets a healthy process that later talks to an empty Git URI.
The same missing placeholder also risks the existing native-profile inbound test, which never sets CONFIG_REPO_URI. Native fixtures must keep working without a Git remote; the default Git profile must refuse unset and blank authority before any clone.
Next action: add a default-profile context failure for unset and blank CONFIG_REPO_URI, keep native independently startable, delete or rename the fake live test, and refresh doctoring to develop@e8373b7 only after that evidence exists. Then re-run ./mvnw -B -pl config-server test on the exact new head before asking for merge.
CodeRabbit did not complete a review on this PR (manual trigger was rate-limited). Findings above are from the diff, the existing native @SpringBootTest, and the Spring Cloud Config 5.0.4 Git backend contract.
Sent by Cursor Automation: Fix Issues
| class ConfigServerRepositoryAuthorityLiveTest { | ||
|
|
||
| @Test | ||
| void missingRepositoryAuthorityFailsClosedWithoutDemoRemote() throws IOException { |
There was a problem hiding this comment.
This class name and assertion text claim a live fail-closed startup. The method only Files.readStrings application.yml and repeats the same three contains checks as ConfigServerRepositoryConfigurationTest. It never starts ConfigServerApplication, never unsets CONFIG_REPO_URI, and never asserts context failure.
Spring Cloud Config 5.0.4 JGitEnvironmentRepository.afterPropertiesSet accepts a non-null empty URI when cloneOnStart is false, so CONFIG_REPO_URI="" still boots and defers Git work to the first request. Replace this with a default-profile context test that fails closed on unset and blank CONFIG_REPO_URI before merge.
| server: | ||
| git: | ||
| uri: ${CONFIG_REPO_URI:https://github.com/your-repo/config-repo.git} | ||
| uri: ${CONFIG_REPO_URI} |
There was a problem hiding this comment.
Removing the demo default is the right destination-authority change. It is not yet fail-closed:
- Unset
CONFIG_REPO_URIis an untested placeholder failure and also breaks the existing native-profile inbound test, which never supplies this variable. - Blank
CONFIG_REPO_URIbinds to"". SCC 5.0.4 treats that as a valid URI and starts.
Keep the token with no demo remote, then add a non-native validator (or profile-scoped YAML) that rejects blank authority and keeps the native fixture profile independently startable. Do not enable skipSslValidation or invent a product-owned repository URL.
|
|
||
| ## Evidence and replacement lineage | ||
|
|
||
| `ConfigServerRepositoryAuthorityLiveTest` on replacement PR #322 establishes current-base RED against the real deployable YAML. `ConfigServerRepositoryConfigurationTest` preserves the earlier behavior and doctoring contracts from PR #189. The replacement branch carries both tests plus the one-line production correction and this source-backed evidence; old PR #189 must not merge separately after exact unique-work preservation and current-head acceptance are proven. |
There was a problem hiding this comment.
This sentence is not true on 50ddcc0. The named test is a YAML substring scan, not current-base RED against a running Git backend. Live develop is e8373b7, not d6c6665. Update this file only after a real context failure exists for unset and blank CONFIG_REPO_URI.
|
Repair for the fail-closed gap is #327 ( Next action: review #327, set |


Purpose
Fail closed when the independently runnable Config Server has no deployment-approved Git repository. The deployable
spring.cloud.config.server.git.urinow uses only${CONFIG_REPO_URI}and no longer converts a missing deployment decision into an outbound request to a demo repository.Exact current identity
develop@d6c6665163eabe1b5eca80556c6963bafd6b2625;repair/config-repository-authority-8f96517;c5f3332d43913296d8937a577e0df088d97d4720;622e882c9d2f6d7d78fa98afb771fb52a3ac5382and exact protected develop;No history was rewritten. Checks, reviews, approvals, and synthetic merge evidence from #189 or predecessor heads do not transfer.
RED evidence
CI
31722379339reached normal production and test execution on macOS, Ubuntu, and Windows and failed on the new repository-authority contract because protected configuration still contained the demo HTTPS fallback. Dependency Review, SBOM, SAST, and Security Scan were otherwise terminal-success on that test-only head. The failure was at the intended deployable configuration boundary, not setup, dependency, fixture, or runner initialization.GREEN implementation
uri: ${CONFIG_REPO_URI};cloneOnStart,skipSslValidation, trust and credential provenance, failure behavior, rollback, standalone/MSA implications, and APA 7 primary references;Current verification state
Fresh exact-current-head CI, Dependency Review, CycloneDX SBOM, SAST Semgrep, and Security Scan were triggered by the current-base GREEN. Pending or predecessor-head results are not accepted as passing.
Keep Draft until the unchanged exact head has terminal-success applicable checks, non-vacuous owned-production coverage, zero valid unresolved findings, and qualifying independent formal review where live governance requires it. After exact semantic preservation and current-head acceptance are proven, old PR #189 should be closed as superseded rather than merged separately.
Closes #179 only after protected integration.