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
6 changes: 3 additions & 3 deletions .github/templates/README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ By default adding an endpoint explicitly allows access to it, use `!` to block i

| Config (Allow) | (Block) | Result | | | |
| :------------- | :------------- | :--------: | --- | :---------------: | --- |
| `/v2/send` | `unset` | **all** | 🛑 | **`/v2/send`** | ✅ |
| `unset` | `!/v1/receive` | **all** | ✅ | **`/v1/receive`** | 🛑 |
| `!/v2*` | `/v2/send` | **`/v2*`** | 🛑 | **`/v2/send`** | ✅ |
| `/v2/send` | `unset` | **all** | ⛔️ | **`/v2/send`** | ✅ |
| `unset` | `!/v1/receive` | **all** | ✅ | **`/v1/receive`** | ⛔️ |
| `!/v2*` | `/v2/send` | **`/v2*`** | ⛔️ | **`/v2/send`** | ✅ |

### Variables

Expand Down
28 changes: 28 additions & 0 deletions docs/configuration/port.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,31 @@ title: Port
# Port

To change the port which **Secured Signal API** uses, you need to set `service.port` in your config. (default: `8880`)

## Token-specific ports (port realms)

You can additionally define a port per Token config.

> [!NOTE]
> Each port spawns a separate listener, beware that this _can_ mildly affect performance

When a token specifies a port, a new **realm** is created for that port.
Only tokens that explicitly belong to the same realm are accepted on that port.

### Example

- `TOKEN_1` → port `8880`
- `TOKEN_2` → port `8890`

Requests behave as follows:

| Token | Port | Result |
| :-------- | :----- | :----: |
| `TOKEN_1` | `8880` | ✅ |
| `TOKEN_2` | `8880` | ⛔️ |
| `TOKEN_1` | `8890` | ⛔️ |
| `TOKEN_2` | `8890` | ✅ |

If a token config does not specify a port, it automatically gets assigned to the default realm.

This allows strict separation of access by port without running multiple instances.