Skip to content

fix(config): reject blank Config Server repository authority - #327

Open
seonghobae wants to merge 13 commits into
developfrom
cursor/bc-bd8286b7-f5d0-41f4-b0d0-80d116480a1e-accc
Open

fix(config): reject blank Config Server repository authority#327
seonghobae wants to merge 13 commits into
developfrom
cursor/bc-bd8286b7-f5d0-41f4-b0d0-80d116480a1e-accc

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

What changed

Default-profile Config Server now rejects unset, blank, unresolved, and demo CONFIG_REPO_URI values at startup. The YAML token stays ${CONFIG_REPO_URI} with no demo remote. The native fixture profile still starts without a Git remote.

Why this change

PR #322 removed https://github.com/your-repo/config-repo.git but did not fail closed. Local ./mvnw -B -pl config-server test on 50ddcc0 showed unset and blank CONFIG_REPO_URI starting Tomcat. Spring Cloud Config 5.0.4 accepts a non-null empty URI when cloneOnStart is false.

Risk and rollout notes

  • Runtime or service risk: set CONFIG_REPO_URI to a reviewed Git URI before starting the default profile. Use native only for local fixtures.
  • Data or migration risk: none.
  • Rollback approach: revert this commit. Do not restore the demo remote.

File-level intent and rationale

File Change(add/edit/delete/move) Intent Why Risk/Notes
ConfigServerRepositoryAuthority.java add Reject blank/unresolved/demo URIs SCC 5.0.4 boots on empty URI Local check, no clone
ConfigServerRepositoryAuthorityValidator.java add Run the check on default startup YAML token change is not enough @Profile("!native")
application.yml edit Operator next-action comment Tell operators to set CONFIG_REPO_URI Token unchanged
ConfigServerRepositoryAuthorityLiveTest.java edit Start the real app Prove unset/blank fail before Git access server.port=0
docs/doctoring/config-server-repository-authority.md edit Honest live evidence + APA 7 Previous live-test claim was false active_pr until develop

Test evidence

  • ./mvnw -B -pl config-server test with Temurin 25.0.4
  • Evidence: 9/9 passed. Live tests failed closed on the validator. Native inbound security still starts without CONFIG_REPO_URI.

Merge-gate evidence

Security checklist

  • No secrets/credentials/private keys added
  • Authn/authz impact reviewed
  • Dependency/workflow security impact reviewed
  • New external inputs validated

Reviewer focus areas

  • Confirm blank and unset CONFIG_REPO_URI stop the default profile before JGit runs.
  • Confirm native fixtures still start without a remote.

Summary by CodeRabbit

  • 새 기능

    • Config Server가 명시적인 Git 저장소 URI 없이는 시작되지 않도록 검증을 추가했습니다.
    • 빈 값, 미해결 설정값, 데모 저장소 주소를 거부합니다.
    • 로컬 fixture 사용 시 native 프로필을 지원합니다.
  • 문서

    • Config Server의 독립 실행, 저장소 설정, 운영 및 보안 절차를 문서화했습니다.
  • 테스트

    • 누락되거나 잘못된 저장소 설정과 유효한 HTTPS·파일 경로 설정을 검증하는 테스트를 추가했습니다.

Devin Review

seonghobae and others added 5 commits August 13, 2026 19:51
Removing the demo Git default is not fail-closed: Spring Cloud Config
5.0.4 still starts with an unset or empty CONFIG_REPO_URI. Validate
destination authority at default-profile startup and keep native fixtures
independently startable.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 14f3de66-7c47-4523-b9da-b0772439b020

📝 Walkthrough

Walkthrough

Config Server의 기본 Git 프로필에서 데모 저장소 fallback을 제거했습니다. CONFIG_REPO_URI가 명시되지 않으면 시작을 중단합니다. URI 검증기, 테스트, 운영 문서를 추가했습니다.

Changes

Config Server 저장소 권한

Layer / File(s) Summary
저장소 URI 검증 및 시작 연계
config-server/src/main/java/com/xtrmetl/config/*, config-server/src/main/resources/application.yml
CONFIG_REPO_URI가 누락되거나 유효하지 않으면 IllegalStateException을 발생시킵니다. native 프로필은 검증 대상에서 제외합니다.
권한 검증 및 시작 실패 테스트
config-server/src/test/java/com/xtrmetl/config/*
잘못된 URI의 거부, 명시적 HTTPS 및 file: URI의 허용, 기본 Git 프로필의 시작 실패를 검증합니다.
운영 규칙 및 저장소 구성 문서
docs/doctoring/config-server-repository-authority.md, AGENTS.md, ARCHITECTURE.md, CHANGELOG.md, CLAUDE.md
저장소 권한, 보안 설정, native 프로필, 독립 실행 범위, 롤백 규칙과 관련 문서 경로를 기록합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🟡 Moderate · up to 43c40

When the default and native profiles are combined, repository validation can be bypassed and the service may start without a repository authority; one live test is also sensitive to the caller’s environment. These bounded correctness and verification risks should be addressed or explicitly accepted before merging.

Sequence Diagram(s)

sequenceDiagram
  participant Startup as Spring Boot Config Server 시작
  participant Validator as ConfigServerRepositoryAuthorityValidator
  participant Authority as ConfigServerRepositoryAuthority
  participant GitBackend as Config Server Git backend

  Startup->>Validator: afterPropertiesSet() 호출
  Validator->>Authority: requireExplicitRepository(repositoryUri) 호출
  Authority-->>Validator: 검증 결과 또는 IllegalStateException 반환
  Validator-->>Startup: 시작 계속 또는 시작 실패
  Startup->>GitBackend: CONFIG_REPO_URI로 Git backend 초기화
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 기본 Config Server 저장소 권한 검증이라는 주요 변경을 간결하고 정확하게 설명합니다.
Linked Issues check ✅ Passed 변경 사항은 [#189]의 명시적 CONFIG_REPO_URI 요구, fail-closed 시작 검증, 데모 원격 제거, native 프로필 보존 및 문서화 요구를 충족합니다.
Out of Scope Changes check ✅ Passed 구현, 테스트 및 문서 변경은 [#189]의 저장소 권한 검증 범위와 직접 관련되며 인증, 자격 증명, 토폴로지 변경은 포함하지 않습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/bc-bd8286b7-f5d0-41f4-b0d0-80d116480a1e-accc

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.

coderabbitai[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

@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

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Devin Review

Comment on lines +52 to +61
String repositoryUri;
try {
repositoryUri = environment.getProperty(REPOSITORY_URI_PROPERTY);
} catch (IllegalArgumentException unresolvedPlaceholder) {
throw new IllegalStateException(
ConfigServerRepositoryAuthority.MISSING_AUTHORITY_MESSAGE,
unresolvedPlaceholder
);
}
ConfigServerRepositoryAuthority.requireExplicitRepository(repositoryUri);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Only the top-level git URI is validated

requireExplicitRepository inspects only spring.cloud.config.server.git.uri. A composite backend or named repos (...git.repos.<name>.uri) with a blank top-level URI would fail closed despite being validly configured. Outside the default single-URI setup this constrains future config shapes.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae seonghobae added the bug Something isn't working label Sep 7, 2026 — with ChatGPT Codex Connector
seonghobae added a commit that referenced this pull request Sep 8, 2026
Port #327 live isolation and native-only composition into #328 without
dropping demo, template, Unicode, or SCP matching. Unset CONFIG_REPO_URI
now fails with the finite authority message after systemEnvironment is
removed, and mixed native profiles cannot skip Git destination checks.

Verified: ./mvnw -B -pl config-server -am test (Temurin 25, 19 tests).
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.

2 participants