Appearance
Access, bans and lists API Since v0.1
Bans take effect on every node that shares the ban store. Lists are named lists used by access rules. For the keys, see Access, rate limits, bans and identity.
For the base URL, sign-in, roles and error format, see Management API. Except sign-in, a route answers 401 without credentials and 403 when the role is too low.
Routes
Bans
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/bans | viewer, all applications | Lists active bans. | none |
POST | /v1/bans | operator, all applications | Bans a client address. | Body: client (IP), for (duration, at most 720h), reason. |
DELETE | /v1/bans/{client} | operator, all applications | Lifts a ban. | none |
Lists and rules
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/lists | viewer | Lists every named list with its source and size. | none |
GET | /v1/apps/{name}/rules/{list} | viewer | Returns one access rule list of an application. | Returns the current values with base_version. |
PUT | /v1/apps/{name}/rules/{list} | operator | Replaces one access rule list of an application. | Body: items (the whole list; [] removes it), base_version, comment, dry_run. |
GET | /v1/config/lists/{list} | viewer, all applications | Returns one global list. | Returns the current values with base_version. |
PUT | /v1/config/lists/{list} | operator, all applications | Replaces one global list. | Body: items (the whole list; [] removes it), base_version, comment, dry_run. |
GET | /v1/geoip Since v0.2 | viewer | Returns the geolocation database status and attribution. | none |
Rate-limit suggestions
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/apps/{name}/ratelimit/suggestions Since v0.2 | viewer | Lists suggested rate limits. | none |
POST | /v1/apps/{name}/ratelimit/suggestions/run Since v0.2 | operator | Computes new suggestions from recent traffic. | none |
POST | /v1/apps/{name}/ratelimit/suggestions/{id}/accept Since v0.2 | operator | Accepts a suggestion into the configuration. | Body: base_version, comment. |
POST | /v1/apps/{name}/ratelimit/suggestions/{id}/reject Since v0.2 | operator | Rejects a suggestion. | none |
Identity
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/apps/{name}/identity Since v0.2 | viewer | Returns identity (token and session recognition) settings. | Returns the current values with base_version. |
PUT | /v1/apps/{name}/identity Since v0.2 | operator | Changes identity settings. | Body: set (key to value; empty string resets the key), base_version (required), comment, dry_run. |
POST | /v1/apps/{name}/identity/test Since v0.2 | viewer | Tests which consumer a sample request resolves to. Viewers see masked labels. | Body: ip, headers, cookies, path, consumer, consumer_kind, claims. |
POST | /v1/apps/{name}/identity/rotate-key Since v0.2 | operator | Rotates the identity signing key. | none |
File lists and ICAP servers
| Method | Path | Minimum role | What it does | Main fields |
|---|---|---|---|---|
GET | /v1/file-lists | viewer | Lists downloadable file-type lists. | none |
PUT | /v1/file-lists | operator, all applications | Replaces the file-type list definitions. | Body: items (the whole list; [] removes it), base_version, comment, dry_run. |
POST | /v1/file-lists/{name}/refresh | operator, all applications | Downloads a file-type list now. | none |
GET | /v1/icap-servers | viewer | Lists antivirus (ICAP) servers. | none |
PUT | /v1/icap-servers | admin, all applications | Replaces the ICAP server definitions. | Body: items (the whole list; [] removes it), base_version, comment, dry_run. |
POST | /v1/icap-servers/{name}/test | admin, all applications | Connects to an ICAP server and reports the result. | none |
PUT | /v1/icap-servers/{name}/ca | admin, all applications | Sets the CA certificate for an ICAP server. | Body: ca (PEM), base_version, comment, dry_run. |
PUT | /v1/icap-servers/{name}/client-certificate | admin, all applications | Sets the client certificate and key for an ICAP server. | Body: cert, key, base_version, comment, dry_run. |
Example
sh
curl -sk -X POST -H "Authorization: Bearer waap_EXAMPLE" -H "Content-Type: application/json" -d '{"client":"203.0.113.7","for":"1h","reason":"scanner"}' https://127.0.0.1:9443/v1/bans