Skip to content

Commit

Permalink
Add information on MSC3873 dotted-path escape rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Mar 14, 2023
1 parent 6339df6 commit 4fe1ca3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
14 changes: 14 additions & 0 deletions content/appendices.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,20 @@ uses the following rules:
* The character `*` matches zero or more characters.
* `?` matches exactly one character.

## Dot-separated property paths

It is useful to express the "path" to an event property by concatenating property
names with dots, e.g. `content.body` would represent the a `body` property in the
event's `content`.

To handle ambiguity when a property name contains a dot, any literal dot or
backslash found in a property name should be escaped with a backslash. E.g. a
property `m.relates_to` in the `content` would be expressed as
`content.m\.relates_to`.

It is recommended that implementations do not redundantly escape characters, as
other escape sequences are reserve for future use.

## Security Threat Model

### Denial of Service
Expand Down
12 changes: 6 additions & 6 deletions content/client-server-api/modules/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ The following conditions are defined:

This is a glob pattern match on a property of the event. Parameters:

- `key`: The dot-separated path of the property of the event to match, e.g.
`content.body`.
- `key`: The [dot-separated path of the property](/appendices#dot-separated property paths)
of the event to match, e.g. `content.body`.

- `pattern`: The [glob-style pattern](/appendices#glob-style-matching) to match against.

Expand Down Expand Up @@ -297,8 +297,8 @@ For an example of this, see the default rule

This is an exact value match on a property of the event. Parameters:

- `key`: The dot-separated path of the property of the event to match, e.g.
`content.body`.
- `key`: The [dot-separated path of the property](/appendices#dot-separated property paths)
of the event to match, e.g. `content.body`.

- `value`: The value to match against.

Expand Down Expand Up @@ -341,8 +341,8 @@ The following `m.federate` values will NOT match:

This matches if an array property of an event exactly contains a value. Parameters:

- `key`: The dot-separated path of the property of the event to match, e.g.
`content.body`.
- `key`: The [dot-separated path of the property](/appendices#dot-separated property paths)
of the event to match, e.g. `content.body`.

- `value`: The value to match against.

Expand Down

0 comments on commit 4fe1ca3

Please sign in to comment.