mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 09:28:29 +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,
|
name?: string,
|
||||||
limit?: number | "unlimited",
|
limit?: number | "unlimited",
|
||||||
ips?: (CIDRString | IPString)[],
|
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 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.
|
- 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 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.
|
- 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