Skip to content

Commit

Permalink
Move the URL schema to the general spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Oct 22, 2024
1 parent f32759f commit d6db258
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
14 changes: 13 additions & 1 deletion lichat.mess
Original file line number Diff line number Diff line change
Expand Up @@ -425,4 +425,16 @@ The following are general conventions for server and client implementors. Howeve

The default port when served over TCP should be ``1111``, with ``1112`` being the default for SSL connections.

When specified in URLs, Lichat takes the ``lichat`` protocol and follows this general scheme: ``lichat://host:port/channel#id`` Meaning the URL path (if given) is used as the name for a channel to join. The URL fragment can be used to specify a specific message id. Note that it is the client's responsibility to ensure that the ID is sufficiently unique so that the URL will link to the correct message. The query part of the URL may be used for client-specific purposes.
When specified in URLs, Lichat takes the ``lichat`` protocol and follows this general scheme:

::
URL ::= 'lichat://' HOST (':' PORT)? '/' (CHANNEL ('#' MESSAGE)?)?
HOST --- The server hostname
PORT --- The server port. If unspecified defaults to 1111
CHANNEL --- An URL-encoded version of the channel name
MESSAGE ::= USER '@' ID
USER --- An URL-encoded version of the message FROM
ID --- An URL-encoded version of the message ID
::

Or in other words, the protocol should be ``lichat``, the path is the channel name, and the fragment encodes the message. It needs to encode both the sender and ID in order to uniquely identify the message, as IDs are only meant to be unique per user. The URL's query parameters are left unspecified and may be used by clients and servers to include additional information.
19 changes: 1 addition & 18 deletions shirakumo.mess
Original file line number Diff line number Diff line change
Expand Up @@ -675,24 +675,7 @@ When the server receives a ``connect`` update for an account for which one-time-

1. The ``otp-token`` is verified for validity against the stored ``otp-key`` by an implementation-specific mechanism. If the token is not valid or not provided, an ``invalid-password`` update is returned and the connection is closed.

## 25. URL (shirakumo-url)
Purpose: specifies a URL format to reference specific messages.

This does not introduce any protocol extensions and instead specifies a URL format that clients should be able to interpret to link to servers, channels, and specific messages. The specific format is as follows:

::
URL ::= 'lichat://' HOST (':' PORT)? '/' (CHANNEL ('#' MESSAGE)?)?
HOST --- The server hostname
PORT --- The server port. If unspecified defaults to 1111
CHANNEL --- An URL-encoded version of the channel name
MESSAGE ::= USER '@' ID
USER --- An URL-encoded version of the message FROM
ID --- An URL-encoded version of the message ID
::

Or in other words, the protocol should be ``lichat``, the path is the channel name, and the fragment encodes the message. It needs to encode both the sender and ID in order to uniquely identify the message, as IDs are only meant to be unique per user. The URL's query paramaters are left unspecified and may be used by clients and servers to include additional information.

## 26. Roles (shirakumo-roles)
## 25. Roles (shirakumo-roles)
Purpose: allows grouping sets of permissions into roles for easier management.

A new server-side object is introduced called ``role`` with the following attributes:
Expand Down

0 comments on commit d6db258

Please sign in to comment.