-
Notifications
You must be signed in to change notification settings - Fork 0
License Refresh Strategy & SQL Commands #70
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Story 5.7: License Refresh Strategy & SQL Commands
FRs covered: FR37, FR38
Depends on: Issue #67 (Expiry Grace Period & Degradation)
Blocking: Issue #68 (Refresh Scheduler & Telemetry)
Description
Implement the LicenseRefreshStrategy trait with two runtime-context-aware implementations, plus SHOW LICENSE and REFRESH LICENSE SQL commands.
Two Refresh Strategies
AutoRefreshStrategy-- for long-running processes (REPL, Arrow Flight SQL, Federation). Delegates to the refresh scheduler (Story 5.8) for periodic background refresh (24h cycle).OnDemandRefreshStrategy-- for driver contexts (JDBC, ADBC). Fetch-once at startup (cache -> config -> backend), then cache result. NO implicit network calls during query execution. On JWT expiry mid-session: silent fallback to Community tier. Refresh only via explicitREFRESH LICENSEcommand.
New SQL Commands
SHOW LICENSE-- returns license type (Community/Pro/Enterprise), quota values (max MVs, max clusters, max result rows, max concurrent queries), and expiration date (or "never" for Community)REFRESH LICENSE-- forces immediate license refresh from backend (API key fetch), updates in-memory license and disk cache, returns previous tier -> new tier and new expiration
Acceptance Criteria
LicenseRefreshStrategytrait withinitialize(): LicenseKeyandrefresh(): LicenseKeyAutoRefreshStrategywired for REPL/Flight SQL/Federation contextsOnDemandRefreshStrategywired for JDBC/ADBC contexts -- no implicit network calls- Expired JWT in driver context -> silent Community fallback, no error
SHOW LICENSEparser rule (case-insensitive(?i)) producingShowLicensequeryREFRESH LICENSEparser rule (case-insensitive(?i)) producingRefreshLicensequery- Both commands route through
GatewayApi.run()like all other commands REFRESH LICENSEwith no API key returns informational message
Technical Notes
- SQL parser rules must use
(?i)regex for case-insensitivity (per Issue SQL parser SHOW/DDL/DML keywords are case-sensitive #61) - Strategy is injected by runtime context: JDBC/ADBC ->
OnDemandRefreshStrategy, REPL/Flight SQL/Federation ->AutoRefreshStrategy REFRESH LICENSEworks in all contexts (manual override)
Related
- Issue Feature & Quota Extensions #62 -- Feature & Quota Extensions
- Issue JWT License Key Validation (Ed25519) #63 -- JWT License Key Validation
- Issue License Configuration & Resolution Priority #64 -- License Configuration & Resolution Priority
- Issue API Key Client & JWT Fetch #65 -- API Key Client & JWT Fetch
- Issue Disk Cache & Offline Fallback #66 -- Disk Cache & Offline Fallback
- Issue Expiry Grace Period & Degradation #67 -- Expiry Grace Period & Degradation (dependency)
- Issue Refresh Scheduler & Telemetry #68 -- Refresh Scheduler & Telemetry (depends on this)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request