ThrillConnect
ThrillConnect allows for reducing the load on the Wallet Auth endpoint using the following strategies.
Failed tokens cache
ThrillConnect service can now be configured to keep track of tokens that failed authentication and directly reject subsequent requests with known invalid tokens, skipping the wallet auth call. Token that failed auth is only cached when the wallet responds with 401 to the auth request.
The default TTL of the cache is 120s.
The feature is activated with the following env config.
TCS_ENABLE_FAILED_TOKEN_CACHE=true
Token Preflight Validation
ThrillConnect service can now be configured to pre-validate the player token. Validations are bound to operator:brand. Validations are configured via the ThrillConnect admin API.
We support the following validations:
- Regex: token must match a regex to be considered valid
- JWT: JWT token signature validation via JWKS
Two new env variables control the behavior:
TCS_ENABLE_PREFLIGHT=true
TCS_MUST_PREFLIGHT=false
The feature is activated with TCS_ENABLE_PREFLIGHT=true.
TCS_MUST_PREFLIGHT enables a more strict mode where a token is only considered valid if a preflight is available and successful.
Example: Configuring a Regex Preflight for operator:brand1
In this example we will setup a token preflight validation for operator:brand1, enforcing that a valid token needs to have exactly 7 digits.
- Request:
POST https://thrillconnect.host-name/v1/admin/validations/operator/brand1 - Headers:
Authorization: Bearer [TOKEN]
- Body (JSON):
{
"Regex": "^\\d{7}$"
}