Skip to content

fix(desktop): preserve secrets-engine auth fallback behavior - #4707

Merged
aheritier merged 1 commit into
mainfrom
fix/secrets-engine-compatibility
Oct 22, 2026
Merged

aheritier merged 1 commit into
mainfrom
fix/secrets-engine-compatibility

Conversation

@dgageot

@dgageot dgageot commented Oct 22, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #4535. Preserves legacy auth fallback behavior now that the secrets-engine path is in main:

  • SecretsEngineError returns a nonblocking snapshot instead of blocking on an in-flight lookup, so a slow/stalled engine can no longer stall debug auth or lose the legacy account info while a lookup is pending.
  • Live and cached secrets-engine expiry checks now go through a new shared hubauth.ExpiringAt helper (issuer-corrected time + skew leeway) instead of duplicating the leeway math.
  • Staging DNS hostname classification is now case-insensitive.
  • Adds regression coverage against the real secrets-engine SDK client for absent socket, HTTP 404, and HTTP 501 responses, confirming fallback to the Desktop/minting path with legacy account details and cooldown.

Tests

  • task build, task test, task lint (0 issues)
  • go test -race ./pkg/desktop ./pkg/environment ./pkg/hubauth ./pkg/sandbox ./cmd/root
  • Shuffled race runs (5x) for pkg/desktop and pkg/hubauth
  • Windows cross-compile of pkg/desktop tests, linux/arm64 build of pkg/desktop+pkg/hubauth, js/wasm build of cmd

SecretsEngineError no longer blocks on an in-flight lookup, so callers
get an immediate "slow" error instead of stalling; the stalled engine
still keeps serving the legacy account info in the meantime. Expiry
checks for live and cached sessions now go through the shared
skew-aware ExpiringAt helper instead of duplicating the leeway math.
Staging host detection for DNS hosts is now case-insensitive.

Adds coverage against a real secrets-engine SDK client for missing
socket, 404, and 501 responses to confirm the legacy fallback kicks in.

Assisted-By: docker-agent
@dgageot
dgageot requested a review from a team as a code owner October 22, 2026 15:20
@aheritier aheritier added area/security Authentication, authorization, secrets, vulnerabilities kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Oct 22, 2026
@aheritier
aheritier added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 9699998 Oct 22, 2026
16 checks passed
@aheritier
aheritier deleted the fix/secrets-engine-compatibility branch October 22, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security Authentication, authorization, secrets, vulnerabilities kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants