-
Notifications
You must be signed in to change notification settings - Fork 0
LicenseManager currentLicenseKey accessor & JwtLicenseManager checkExpiry #71
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Add two foundational capabilities to the licensing module that are prerequisites for Story 5.7 (License Refresh Strategy & SQL Commands, Issue #70).
1. currentLicenseKey accessor on LicenseManager trait
LicenseManager currently exposes licenseType, quotas, graceStatus but not the underlying LicenseKey. The SHOW LICENSE command (Issue #70) needs expiresAt which is only available on LicenseKey.
- Add
def currentLicenseKey: LicenseKey = LicenseKey.Communitydefault method toLicenseManagertrait (backward compatible) - Override in
JwtLicenseManagerto returnstate.get().licenseKey
2. checkExpiry() method on JwtLicenseManager
JwtLicenseManager.validate() stores state at call time but never re-checks expiry. Without runtime expiry checking, a JWT valid at initialize() time remains Pro/Enterprise forever in the in-memory state — making mid-session Community fallback unimplementable.
- Add
checkExpiry()method that re-checks storedLicenseKey.expiresAtagainstInstant.now() - If expired beyond grace period: calls
resetToCommunity() - If expired but within grace period: recomputes
GraceStatus(EarlyGrace/MidGrace) - If not expired: no-op
- Idempotent and cheap — just compares timestamps
Module
licensing
Related
- Issue License Refresh Strategy & SQL Commands #70 — License Refresh Strategy & SQL Commands (depends on this)
- Issue Expiry Grace Period & Degradation #67 — Expiry Grace Period & Degradation (prerequisite, FIXED)
- Issue JWT License Key Validation (Ed25519) #63 — JWT License Key Validation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request