mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-27 17:08:28 +00:00
docs/protect-an-instance: add info about allowedServices in api keys
This commit is contained in:
parent
3243564f77
commit
dce9eb30c1
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user