Clarify the documentation. Add the hash config to the example config. Uses duration in the delay field instead of the seconds.

This commit is contained in:
Anatoly Sablin
2019-12-05 23:27:13 +03:00
parent 7509174611
commit cbb9fced8d
7 changed files with 124 additions and 13 deletions

View File

@@ -70,21 +70,31 @@ There is only one exception: [`POST /_matrix/identity/v2/terms`](https://matrix.
## [Hash lookup](https://github.com/matrix-org/matrix-doc/blob/hs/hash-identity/proposals/2134-identity-hash-lookup.md)
Hashes and the pepper updates together according to the `rotationPolicy`.
```.yaml
hashing:
enabled: true # enable or disable the hash lookup MSC2140 (default to false)
enabled: true # enable or disable the hash lookup MSC2140 (default is false)
pepperLength: 20 # length of the pepper value (default is 20)
rotationPolicy: per_requests # or `per_seconds` how often the hashes will be updating
hashStorageType: sql # or `in_memory` where the hashes will be stored
algorithms:
- none # the same as v1 bulk lookup
- sha256 # hash the 3PID and pepper.
delay: 10 # how often hashes will be updated if rotation policy = per_seconds (default is 10)
delay: 2m # how often hashes will be updated if rotation policy = per_seconds (default is 10s)
requests: 10 # how many lookup requests will be performed before updating hashes if rotation policy = per_requests (default is 10)
```
When enabled and client requests the `none` algorithms then hash lookups works as v1 bulk lookup.
Delay specified in the format: `2d 4h 12m 34s` - this means 2 days 4 hours 12 minutes and 34 seconds. Zero units may be omitted. For example:
- 12s - 12 seconds
- 3m - 3 minutes
- 5m 6s - 5 minutes and 6 seconds
- 6h 3s - 6 hours and 3 seconds
Sha256 algorithm supports only sql, memory and exec 3PID providers.
For sql provider (i.e. for the `synapseSql`):
```.yaml