-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Epic 5: Licensing Infrastructure
User Story
As a server operator,
I want to configure licensing via HOCON or environment variables with a clear resolution priority,
So that both air-gapped and cloud deployments are supported with predictable behavior.
Acceptance Criteria
Given HOCON configuration with softclient4es.license.key = "eyJ..."
When LicenseConfig loads
Then the static JWT is extracted and available for validation
Given HOCON configuration with softclient4es.license.api-key = "sk-abc123..."
When LicenseConfig loads
Then the API key is extracted and available for JWT fetch
Given an environment variable SOFTCLIENT4ES_LICENSE_KEY is set
When LicenseConfig loads with no HOCON key configured
Then the env var value is used as the static JWT
Given an environment variable SOFTCLIENT4ES_API_KEY is set
When LicenseConfig loads with no HOCON api-key configured
Then the env var value is used as the API key
Given both HOCON config and env var are set for the same setting
When LicenseConfig loads
Then the environment variable takes precedence
Given the resolution priority chain
When a valid, non-expired static JWT is configured
Then it is used directly — API key fetch and disk cache are not consulted
Given a static JWT that is expired beyond the grace period
When an API key is also configured
Then the API key is used to fetch a fresh JWT from the backend (Step 2 of priority chain)
Given neither static JWT nor API key is configured
When JwtLicenseManager initializes
Then Community tier is assumed as the default
And an INFO log is emitted: "Running in Community mode"
Given LicenseConfig with refresh { enabled = true, interval = 24h }, telemetry { enabled = true }, grace-period = 14d, cache-dir = ~/.softclient4es
When configuration is loaded
Then all settings are parsed with correct types and defaults from reference.conf
Dependencies
- JWT License Key Validation (FR22)
Requirements
- FR23: Dual-mode license provisioning: static JWT (air-gapped) and API key (auto-refresh)
- FR24: License resolution priority: static JWT -> API key fetch -> disk cache -> Community default
- FR28: License configuration via HOCON and environment variables