Skip to content

feat(admin): unauthenticated bootstrap-status probe (ADR 0001 §6)#30

Merged
jlc488 merged 2 commits into
mainfrom
feat/bootstrap-status-endpoint
May 31, 2026
Merged

feat(admin): unauthenticated bootstrap-status probe (ADR 0001 §6)#30
jlc488 merged 2 commits into
mainfrom
feat/bootstrap-status-endpoint

Conversation

@jlc488

@jlc488 jlc488 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Implements the forward-looking endpoint ADR 0001 §6 reserved for a guided first-run / setup wizard.

What

GET /admin/api/v1/bootstrap/status{ "initialized": boolean } — where initialized means "at least one account exists".

Unauthenticated by design. A setup wizard has to ask this before any account exists (so before anyone could hold a token). It leaks only a single boolean — never any account detail — so it's safe pre-auth and is whitelisted in AdminSecurityConfig.

Changes

  • BootstrapStatusController + BootstrapStatusResponse (admin-api).
  • AdminSecurityConfig: permitAll for GET .../bootstrap/status only.
  • AdminApiPaths.BOOTSTRAP_STATUS constant.
  • sample-app integration tests over the real HTTP stack: reachable without a token + initialized=true; a sibling admin endpoint still returns 401/403 unauthenticated — guards against an over-broad permitAll matcher.
  • ADR 0001 §6 marked Implemented; CHANGELOG records the whole bootstrap feature set (was never logged) + this probe under [Unreleased].

Verification

./gradlew build --no-daemon green incl. Testcontainers (2 new tests pass).

Note

The wizard UI itself is still future work — this only lands the endpoint it will branch on. Publishing/versioning (0.1.0) is tracked separately and intentionally not touched here.

jlc488 added 2 commits May 31, 2026 10:44
GET /admin/api/v1/bootstrap/status → { initialized: boolean }, where
initialized is "at least one account exists". This is the branch point a
future guided first-run / setup wizard needs to decide whether to show a
"create the first administrator" form — so it must answer before any account
exists, i.e. unauthenticated.

- BootstrapStatusController + BootstrapStatusResponse (admin-api).
- AdminSecurityConfig: whitelist GET .../bootstrap/status (permitAll). It
  leaks only a single boolean, never any account detail.
- AdminApiPaths.BOOTSTRAP_STATUS constant.
- sample-app integration tests over the real HTTP stack: reachable without a
  token + returns initialized=true; a sibling admin endpoint still rejects
  unauthenticated (401/403) — guards against an over-broad permitAll matcher.
- ADR 0001 §6: the forward-looking endpoint is now marked Implemented.
- CHANGELOG: recorded the bootstrap feature set (was missing) + this probe
  under [Unreleased].

Verified: ./gradlew build --no-daemon green (incl. Testcontainers).
…ons)

The first cut imported org.springframework.boot.web.client.RestTemplateBuilder,
which Spring Boot 4 removed from that package; TestRestTemplate and
@AutoConfigureMockMvc are also relocated/absent in the 4.0.6 test artifacts.
Rather than chase the moved packages, drive the endpoint with the JDK's
java.net.http.HttpClient against @LocalServerPort: no Spring HTTP test helper,
no package churn, no throw-on-4xx. Verified with ./gradlew build --no-daemon.
@jlc488
jlc488 merged commit 78726b3 into main May 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant