Guide
Validate on Startup
Startup sequence for reading cached activation state, validating online, updating the cache, and deciding audio/access behavior.
SoundSync
Startup sequence
Treat the local record as untrusted input until it passes schema and context checks.
-
Read encrypted activation record
Load per-product, per-environment, per-machine cache from secure storage.
-
Validate schema
Require status, productId, instance_id, and enough identity for validation such as token, activationId, licenseReference, or license_key context.
-
Confirm context
Check product, App ID, environment, and machine identity match the running build.
-
Decide online validation
Validate on startup when cache exists; do not block the audio thread while waiting.
-
Send /validate
Use product credential headers and canonical request fields.
-
Interpret result
Active updates cache and may rotate token. Explicit denied states lock immediately. Transport failures may use grace only if allowed.
-
Update atomically
Write the new token/timestamps/grace fields in a replace-safe manner.
-
Schedule next validation
Use product policy; do not reset grace locally by restarting.
SoundSync
Validation endpoint
The validation token may rotate. Store the newest returned token.
/api/license/v1/validate
Validate cached activation state on startup or during periodic revalidation.
- Auth
- Product plugin credential. Licensing endpoints require x-ss-app-id, x-ss-plugin-key, and x-ss-plugin-secret headers, or verified body/query aliases.
- Scope
- Product, app, credential, environment, and machine scoped.
- Request fields
- instance_id or machine_id
- validation_token/token or activationId/licenseReference/license key context
- product_id optional
- Returns
- active/denied state, rotated validation token, last validation timestamps, offline grace fields, subscription/license state.
- Side effects
- Refreshes validation state and token when allowed. Explicit denials force lock and must not use offline grace.
SoundSync
Validation request
The license key does not have to be resent when a valid token/activation identity is available, but instance_id/machine_id is required.
curl -sS -X POST "$SOUNDSYNC_API_BASE/api/license/v1/validate" \
-H "Content-Type: application/json" \
-H "x-ss-app-id: ss_prod_demoapp123" \
-H "x-ss-plugin-key: ss_pk_demokey123" \
-H "x-ss-plugin-secret: ss_ps_demosecret123" \
-d '{
"instance_id": "machine-demo-001",
"token": "validation-token-from-activation",
"product_id": "prod_demo_piano"
}'
SoundSync
Client decision table
Never permit grace for explicit platform denials.
| Result | Access behavior | Local state action |
|---|---|---|
| Activated/valid | Unlock or keep unlocked. | Store rotated token, timestamps, grace fields, subscription/license fields. |
| device_not_activated | Lock. | Clear invalid activation state. |
| device_deactivated | Lock immediately. | Delete activation cache. |
| subscription_payment_required | Lock immediately. | Keep diagnostic/support info only. |
| Temporary network failure | Permit only if prior valid cache and graceExpiresAt is in future. | Do not extend grace; retry later. |
| Non-JSON or malformed response | Treat as temporary only if transport/service failure is plausible and prior valid cache exists. | Record sanitized diagnostic; do not overwrite good cache with malformed data. |
