diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-29 20:44:03 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-29 20:44:03 -0400 |
| commit | 9010c7feeca8f4e7e501ad474911deaaf7a1a367 (patch) | |
| tree | e2fb736e7923c0d084ee3ebffe03752dc237edfb /docs | |
| parent | 15311c7bd816a83d0641de6b6bb3c41bb67079db (diff) | |
Restrict channel names, too.
Thankfully, channel creation only happens in one place, so we don't need a state machine for this.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api/channels-messages.md | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/api/channels-messages.md b/docs/api/channels-messages.md index 9854d22..6391b5a 100644 --- a/docs/api/channels-messages.md +++ b/docs/api/channels-messages.md @@ -64,6 +64,14 @@ The request must have the following fields: |:-------|:-------|:--| | `name` | string | The channel's name. | +The proposed `name` must be valid. The precise definition of valid is still up in the air, but, at minimum: + +* It must be non-empty. +* It must not be "too long." (Currently, 64 characters is too long.) +* It must begin with a printing character. +* It must end with a printing character. +* It must not contain runs of multiple whitespace characters. + ### Success This endpoint will respond with a status of `202 Accepted` when successful. The body of the response will be a JSON object describing the new channel: @@ -86,7 +94,11 @@ The returned name may not be identical to the name requested, as the name will b When completed, the service will emit a [channel created](events.md#channel-created) event with the channel's ID. -### Duplicate channel name +### Name not valid + +This endpoint will respond with a status of `400 Bad Request` if the proposed `name` is not valid. + +### Channel name in use This endpoint will respond with a status of `409 Conflict` if a channel with the requested name already exists. |
