Skip to content

Pin UI server routes to a named endpoint - #24

Merged
jpol34 merged 1 commit into
mainfrom
pin-routes-to-named-endpoint
Sep 16, 2026
Merged

jpol34 merged 1 commit into
mainfrom
pin-routes-to-named-endpoint

Conversation

@jpol34

@jpol34 jpol34 commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Closes #22.

Why

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.

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

  • The listening endpoint is now named main (all three variants: Windows HTTPS, non-Windows HTTPS
    via PFX, and plain HTTP).
  • All four secrets API routes and the static UI route are bound to main explicitly.

No behavioural change while there is only one endpoint.

Verification

Exercised against a live server on both code paths:

  • HTTPS mode: static UI route 200, GET /api/secrets 200 (51 entries), reveal 200, POST and
    DELETE 200 (with a disposable secret, cleaned up after), and GET /api/secrets without a
    bearer token still 401.
  • HTTP-only mode (started against a hostname with no certificate): binds port 80, serves the UI
    and the API 200 — confirming routes pinned to main bind correctly whether that endpoint is
    HTTPS or HTTP.
  • Invoke-Pester -Path Tests/Strongbox.Tests.ps1: 43 passed, 0 failed.

🤖 Generated with Claude Code

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>
@jpol34
jpol34 merged commit 252a75f into main Sep 16, 2026
1 check passed
@jpol34
jpol34 deleted the pin-routes-to-named-endpoint branch September 16, 2026 23:01
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.

Pin all UI server routes to a named endpoint

2 participants