Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions docs/configuration/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@ By default, adding an endpoint explicitly allows access to it, use `!` to block

## Behavior

| Allow | Block | Result |
| ---------- | -------------- | -------------------------------------------- |
| `/v2/send` | — | **Only** `/v2/send` allowed |
| — | `!/v1/receive` | **All** allowed **except** `/v1/receive` |
| `/v2/send` | `!/v2/*` | `/v2*` allowed **except** `/v2/send` blocked |
| Allow | Block | Result |
| ---------- | -------------- | ----------------------------------------- |
| `/v2/send` | — | **Only** `/v2/send` allowed |
| — | `!/v1/receive` | **All** allowed, **except** `/v1/receive` |
| `/v2/send` | `!/v2/*` | **Only** `/v2/send` allowed |

### Rules

- Default: **allow all**
- Allow rules add explicit access
- Block rules deny matching endpoints
- Explicit allow overrides block
- Mixed allow + block rules keep permissive default
- Allow rules exist: default **block**
- Only block rules exist: default **allow**
- Explicit allow **overrides** block
27 changes: 26 additions & 1 deletion docs/configuration/field-policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,39 @@ Configure them by using `access.fieldPolicies` like so:
settings:
access:
fieldPolicies:
"@number": { value: "+123400002", action: block }
"@number":
- value: "+123400002"
action: block
- value: "+123400003"
action: allow
```

Set the wanted action on encounter, available options are `block` and `allow`.

> [!TIP]
> String fields always try to use regex matching, on compile error exact match is used as fallback

> [!NOTE]
> Supported [placeholder types](../usage/advanced#placeholders):
>
> | `.` Variables | `@` Body | `#` Headers |
> | ------------- | -------- | ----------- |
> | ❌ | ✅ | ✅ |

## Behavior

| Allow | Block | Result |
| ------------------- | ----------------------- | --------------------------------------------------------------------------- |
| `number=+123400003` | — | `number` may **only** be `+123400003` |
| — | `number=+123400002` | `number` may **not** be `+123400002` |
| `message=hello` | `number=+123400002` | `number` may **not** be `+123400002`<br/> `message` may **only** be `hello` |
| `number=+123400003` | `number=+12340000[2-9]` | `number` may **not** be `+123400002` through `9` **except** `123400003` |

### Rules

- **Field-scoped** (policies for `a` don't affect policies for `b`)

* Default: **allow all**
* Allow rules exist: default **block**
* Only block rules exist: default **allow**
* Explicit allow **overrides** block
19 changes: 10 additions & 9 deletions docs/configuration/ip-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ By default, adding an IP or range explicitly allows it, use `!` to block it inst

## Behavior

| Allow | Block | Result |
| -------------- | ------------------------ | ----------------------------------------- |
| `192.168.1.10` | — | Only `192.168.1.10` allowed |
| — | `!123.456.78.9` | All allowed, except `123.456.78.9` |
| `10.0.0.0/24` | `!10.0.0.10` | `10.0.0.0/24` allowed, except `10.0.0.10` |
| — | `!0.0.0.0/0`<br/>`!::/0` | All IPv4 & IPv6 blocked |
| Allow | Block | Result |
| -------------- | ------------------------ | --------------------------------------------- |
| `192.168.1.10` | — | **Only** `192.168.1.10` allowed |
| — | `!123.456.78.9` | **All** allowed, **except** `123.456.78.9` |
| `10.0.0.0/24` | `!10.0.0.10` | `10.0.0.0/24` allowed, **except** `10.0.0.10` |
| — | `!0.0.0.0/0`<br/>`!::/0` | All IPv4 & IPv6 blocked |

### Rules

- Default: **allow all**
- Allow rules restrict access **only if no block rules exist**
- Block rules deny matching IPs
- Explicit allow overrides block
- Allow rules exist: default **block**
- Only block rules exist: default **allow**
- Explicit allow **overrides** block

- IPv4 and IPv6 rules may be mixed

## Clients behind Proxies
Expand Down
4 changes: 4 additions & 0 deletions docs/configuration/ratelimiting.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ settings:
- `period`: The duration over which the limit is measured (supports Go duration format like `1m`, `10s`, `1h`)

When a request exceeds the configured rate limit the server responds with `429` `Too Many Requests`.

> [!IMPORTANT]
>
> [Trusted clients](./trusted-ips.md) are allowed to bypass rate limits