Skip to content

Fixes for enrollment packages expiration time - #959

Merged
javuto merged 1 commit into
developfrom
fix-enrollment-expiration
Aug 11, 2026
Merged

Fixes for enrollment packages expiration time#959
javuto merged 1 commit into
developfrom
fix-enrollment-expiration

Conversation

@javuto

@javuto javuto commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a secret field with copy/download to the lifecycle tab, and fixes the expiration display that always showed "expires now".

Problem

  1. No secret display — the lifecycle tab had no way to view, copy, or download the enroll secret.
  2. Expiration always "now"formatRelative returned 'just now' for future timestamps, so expires ${formatRelative(futureDate)} rendered as "expires just now".

Changes

Frontend — secret field (frontend/src/features/enrollment/EnrollPage.tsx)

  • New SecretField component in the Lifecycle tab
  • Fetches the enroll secret via GET /api/v1/environments/{env}/enroll/secret
  • Displays in a password-masked text field (hidden by default)
  • Show/Hide button to toggle visibility
  • Copy button to copy to clipboard (shows "Copied ✓")
  • Download button that downloads as osctrl-{environment-name}.secret

Frontend — expiration fix (frontend/src/lib/time.ts)

  • Added formatTimeUntil(iso) — returns "in 3d", "in 2h", "in 4m" for future dates
  • Updated formatRelative to delegate future timestamps to formatTimeUntil instead of returning 'just now'
  • LifecycleCard now shows "expires in 3d" for future dates and "expired 2h ago" for past dates

Validation

  • npm run check — TypeScript typecheck clean
  • npm test — 34 test files / 209 tests pass
  • gofmt clean on all modified files

@javuto javuto added 🚧 bugfix Fix for an existing bug ⭐️ frontend Frontend related issues labels Aug 11, 2026
@javuto
javuto merged commit cb69168 into develop Aug 11, 2026
6 checks passed
@javuto
javuto deleted the fix-enrollment-expiration branch August 11, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚧 bugfix Fix for an existing bug ⭐️ frontend Frontend related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant