41 lines
1.1 KiB
Markdown
41 lines
1.1 KiB
Markdown
# Runtime license client
|
|
|
|
The application uses the client protocol from Universal License Platform v1.0.0.
|
|
|
|
Imports:
|
|
|
|
```go
|
|
import (
|
|
"github.com/b1tsblog/license-platform/pkg/licensekit"
|
|
"github.com/b1tsblog/license-platform/sdk/go/licenseclient"
|
|
)
|
|
```
|
|
|
|
Initialization is performed in `internal/app/server.go`. The product ID and embedded trust store are not customer-configurable.
|
|
|
|
```go
|
|
licenses := licenseclient.New(ctx, licenseclient.Config{
|
|
Product: "ai-disclosure-standard",
|
|
ClientVersion: "2.0.2",
|
|
Token: cfg.LicenseToken,
|
|
TrustStore: trustStore,
|
|
BaseURL: cfg.BaseURL,
|
|
InstanceID: cfg.LicenseInstanceID,
|
|
Mode: cfg.LicenseMode,
|
|
ServerURL: cfg.LicenseServerURL,
|
|
CacheFile: cfg.LicenseCacheFile,
|
|
RefreshEvery: cfg.LicenseRefreshEvery,
|
|
RequestTimeout: cfg.LicenseTimeout,
|
|
})
|
|
```
|
|
|
|
Feature checks remain server-side:
|
|
|
|
```go
|
|
if licenses.Has("custom_badge") {
|
|
// accept custom badge presentation
|
|
}
|
|
```
|
|
|
|
The runtime client contains no license-signing or private-key functionality. See [`LICENSE-INTEGRATION.md`](LICENSE-INTEGRATION.md) for deployment details.
|