Skip to content

LicenseManager currentLicenseKey accessor & JwtLicenseManager checkExpiry #71

@fupelaqu

Description

@fupelaqu

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.Community default method to LicenseManager trait (backward compatible)
  • Override in JwtLicenseManager to return state.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 stored LicenseKey.expiresAt against Instant.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions