feat(admin): unauthenticated bootstrap-status probe (ADR 0001 §6)#30
Merged
Conversation
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.
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.
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 }— whereinitializedmeans "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:permitAllforGET .../bootstrap/statusonly.AdminApiPaths.BOOTSTRAP_STATUSconstant.initialized=true; a sibling admin endpoint still returns 401/403 unauthenticated — guards against an over-broadpermitAllmatcher.[Unreleased].Verification
./gradlew build --no-daemongreen 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.