Skip to content

fix(config): require explicit Config Server repository authority - #322

Open
seonghobae wants to merge 4 commits into
developfrom
repair/config-repository-authority-8f96517
Open

fix(config): require explicit Config Server repository authority#322
seonghobae wants to merge 4 commits into
developfrom
repair/config-repository-authority-8f96517

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Fail closed when the independently runnable Config Server has no deployment-approved Git repository. The deployable spring.cloud.config.server.git.uri now uses only ${CONFIG_REPO_URI} and no longer converts a missing deployment decision into an outbound request to a demo repository.

Exact current identity

  • protected/live base: develop@d6c6665163eabe1b5eca80556c6963bafd6b2625;
  • branch: repair/config-repository-authority-8f96517;
  • exact current head: c5f3332d43913296d8937a577e0df088d97d4720;
  • current head is an auditable two-parent merge descending from both the valid current-base RED predecessor 622e882c9d2f6d7d78fa98afb771fb52a3ac5382 and exact protected develop;
  • exact comparison to live develop: ahead, zero behind, merge base exactly live develop;
  • current diff is the bounded four-file configuration, two contract tests, and source-backed doctoring slice;
  • Draft: true.

No history was rewritten. Checks, reviews, approvals, and synthetic merge evidence from #189 or predecessor heads do not transfer.

RED evidence

CI 31722379339 reached 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

  • exact production configuration: uri: ${CONFIG_REPO_URI};
  • no guessed repository, credential, TLS bypass, network bootstrap, or support-status claim;
  • current-base live contract plus the preserved source/doctoring contract from fix(config): require explicit Config Server repository authority #189;
  • source-backed treatment of cloneOnStart, skipSslValidation, trust and credential provenance, failure behavior, rollback, standalone/MSA implications, and APA 7 primary references;
  • ordinary observability retains finite classifications rather than credential-bearing URLs or unrestricted provider exceptions.

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.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 08195a4e-1435-48a6-9e60-733366215424


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae seonghobae changed the title test(config): require explicit Config Server repository authority fix(config): require explicit Config Server repository authority Aug 15, 2026
@seonghobae
seonghobae marked this pull request as ready for review August 15, 2026 09:56

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

class ConfigServerRepositoryAuthorityLiveTest {

@Test
void missingRepositoryAuthorityFailsClosedWithoutDemoRemote() throws IOException {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the demo default is the right destination-authority change. It is not yet fail-closed:

  • Unset CONFIG_REPO_URI is an untested placeholder failure and also breaks the existing native-profile inbound test, which never supplies this variable.
  • Blank CONFIG_REPO_URI binds 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

Repair for the fail-closed gap is #327 (43c4049). Do not merge this head (50ddcc0). After #327 is accepted, close this PR and #189 as superseded.

Next action: review #327, set CONFIG_REPO_URI to a reviewed Git URI before starting the default Config Server profile, and keep native for local fixtures only.

@opencode-agent opencode-agent Bot added area: auth Authentication, authorization, identity, or tenant isolation priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: bug Defect or incorrect behavior labels Aug 22, 2026
@seonghobae seonghobae added the bug Something isn't working label Sep 7, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: auth Authentication, authorization, identity, or tenant isolation bug Something isn't working priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Operability/Supply chain] Remove fake Config Server Git fallback from supported runtime

1 participant