docs/protect-an-instance: add info about allowedServices in api keys

This commit is contained in:
wukko 2025-06-26 22:23:25 +06:00
parent 3243564f77
commit dce9eb30c1
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -159,7 +159,8 @@ type KeyFileContents = Record<
name?: string,
limit?: number | "unlimited",
ips?: (CIDRString | IPString)[],
userAgents?: string[]
userAgents?: string[],
allowedServices?: "all" | string[],
}
>;
```
@ -179,6 +180,11 @@ where *`UUIDv4String`* is a stringified version of a UUIDv4 identifier.
- when specified, requests with a `user-agent` that does not appear in this array will be rejected.
- when omitted, any user agent can be specified to make requests with that API key.
- **`allowedServices`** is an array of allowed services or `"all"`.
- when `"all"` is specified, the key will be able to access all supported services, even if they're globally disabled via `DISABLED_SERVICES`.
- when an array of services is specified, the key will be able to access only the services included in the array.
- when omitted, the key will use the global list of supported services.
- if both `ips` and `userAgents` are set, the tokens will be limited by both parameters.
- if cobalt detects any problem with your key file, it will be ignored and a warning will be printed to the console.