Repository navigation
Pin UI server routes to a named endpoint - #24
Merged
Merged
Conversation
Pode binds a route registered without -EndpointName to every endpoint, and a concrete static route out-prioritises a wildcard one. That makes adding any second listener hazardous: a plaintext HTTP endpoint would inherit the static UI route and the secrets API rather than being able to serve its own handler. Name the listening endpoint 'main' and bind all four secrets API routes plus the static UI route to it explicitly. No behavioural change with a single endpoint - this is groundwork so a redirect listener can be added safely. Verified: UI loads and lists secrets over HTTPS, reveal/create/delete all work, auth still returns 401 without a token, HTTP-only mode (no cert) unchanged, and the Pester suite passes. Refs #22 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Closes #22.
Why
Pode binds a route registered without
-EndpointNameto every endpoint, and a concrete staticroute out-prioritises a wildcard one. That makes adding any second listener hazardous: a plaintext
HTTP endpoint would inherit the static UI route and the secrets API rather than being able to serve
its own handler.
This is the prefactor for #23 (redirecting a bare hostname to HTTPS). Landing it separately keeps
that trap out of the feature commit and makes it reviewable on its own.
What changed
main(all three variants: Windows HTTPS, non-Windows HTTPSvia PFX, and plain HTTP).
mainexplicitly.No behavioural change while there is only one endpoint.
Verification
Exercised against a live server on both code paths:
GET /api/secrets200 (51 entries), reveal 200,POSTandDELETE200 (with a disposable secret, cleaned up after), andGET /api/secretswithout abearer token still 401.
and the API 200 — confirming routes pinned to
mainbind correctly whether that endpoint isHTTPS or HTTP.
Invoke-Pester -Path Tests/Strongbox.Tests.ps1: 43 passed, 0 failed.🤖 Generated with Claude Code