Separate out information on globbing.

This commit is contained in:
Patrick Cloke 2023-03-06 11:05:03 -05:00
parent 7100f6e68d
commit f264b4f7e8
4 changed files with 15 additions and 14 deletions

View file

@ -934,6 +934,14 @@ The `address` is the telephone number represented as a MSISDN (Mobile
Station International Subscriber Directory Number) as defined by the Station International Subscriber Directory Number) as defined by the
E.164 numbering plan. Note that MSISDNs do not include a leading '+'. E.164 numbering plan. Note that MSISDNs do not include a leading '+'.
## Glob-style matching
It is useful to match strings via globbing in some situations, globbing in Matrix
uses the following rules:
* The character `*` matches zero or more characters.
* `?` matches exactly one character.
## Security Threat Model ## Security Threat Model
### Denial of Service ### Denial of Service

View file

@ -75,8 +75,8 @@ technique for receiving updates to the policy's rules.
#### Events #### Events
The `entity` described by the state events can contain `*` and `?` to The `entity` described by the state events is interpreted as a
match zero or more characters and exactly one character respectively. Note that [glob-style pattern](/appendices#glob-style-matching). Note that
rules against rooms can describe a room ID or room alias - the rules against rooms can describe a room ID or room alias - the
subscriber is responsible for resolving the alias to a room ID if subscriber is responsible for resolving the alias to a room ID if
desired. desired.

View file

@ -264,18 +264,13 @@ This is a glob pattern match on a field of the event. Parameters:
- `key`: The dot-separated path of the property of the event to match, e.g. - `key`: The dot-separated path of the property of the event to match, e.g.
`content.body`. `content.body`.
- `pattern`: The glob-style pattern to match against. - `pattern`: The [glob-style pattern](/appendices#glob-style-matching) to match against.
The match is performed case-insensitively, and must match the entire value of The match is performed case-insensitively, and must match the entire value of
the event field given by `key` (though see below regarding `content.body`). The the event field given by `key` (though see below regarding `content.body`). The
exact meaning of "case insensitive" is defined by the implementation of the exact meaning of "case insensitive" is defined by the implementation of the
homeserver. homeserver.
Within `pattern`:
* The character `*` matches zero or more characters.
* `?` matches exactly one character.
If the property specified by `key` is completely absent from the event, or does If the property specified by `key` is completely absent from the event, or does
not have a string value, then the condition will not match, even if `pattern` not have a string value, then the condition will not match, even if `pattern`
is `*`. is `*`.

View file

@ -7,8 +7,8 @@ description: |-
server ACL. Servers that do not uphold the ACLs MUST be added to the denied hosts server ACL. Servers that do not uphold the ACLs MUST be added to the denied hosts
list in order for the ACLs to remain effective. list in order for the ACLs to remain effective.
The `allow` and `deny` lists are lists of globs supporting `?` and `*` The `allow` and `deny` lists are lists of [glob-style patterns](/appendices#glob-style-matching).
as wildcards. When comparing against the server ACLs, the suspect server's port When comparing against the server ACLs, the suspect server's port
number must not be considered. Therefore `evil.com`, `evil.com:8448`, and number must not be considered. Therefore `evil.com`, `evil.com:8448`, and
`evil.com:1234` would all match rules that apply to `evil.com`, for example. `evil.com:1234` would all match rules that apply to `evil.com`, for example.
@ -61,8 +61,7 @@ properties:
type: array type: array
description: |- description: |-
The server names to allow in the room, excluding any port information. The server names to allow in the room, excluding any port information.
Wildcards may be used to cover a wider range of hosts, where `*` Each entry is interpreted as a [glob-style pattern](/appendices#glob-style-matching).
matches zero or more characters and `?` matches exactly one character.
**This defaults to an empty list when not provided, effectively disallowing **This defaults to an empty list when not provided, effectively disallowing
every server.** every server.**
@ -72,8 +71,7 @@ properties:
type: array type: array
description: |- description: |-
The server names to disallow in the room, excluding any port information. The server names to disallow in the room, excluding any port information.
Wildcards may be used to cover a wider range of hosts, where `*` Each entry is interpreted as a [glob-style pattern](/appendices#glob-style-matching).
matches zero or more characters and `?` matches exactly one character.
This defaults to an empty list when not provided. This defaults to an empty list when not provided.
items: items: