2.2 KiB
2.2 KiB
SQL Identity store
Supported Databases
- PostgreSQL
- MariaDB
- MySQL
- SQLite
Features
Name | Supported? |
---|---|
Authentication | No |
Directory | Yes |
Identity | Yes |
Due to the implementation complexity of supporting arbitrary hashing/encoding mechanisms or auth flow, Authentication will be out of scope of SQL Identity stores and should be done via one of the other identity stores, typically the REST Identity store.
Configuration
Basic
sql.enabled: <boolean>
Enable/disable the identity store
sql.type: <string>
Set the SQL backend to use:
sqlite
postgresql
mariadb
mysql
Connection
SQLite
sql.connection: <string>
Set the value to the absolute path to the Synapse SQLite DB file.
Example: /path/to/sqlite/file.db
Others
sql.connection: //<HOST[:PORT]/DB?username=USER&password=PASS
Set the connection info for the database by replacing the following values:
HOST
: Hostname of the SQL serverPORT
: Optional port value, if not defaultDB
: Database nameUSER
: Username for the connectionPASS
: Password for the connection
This follow the JDBC URI syntax. See official website.
Directory
sql.directory.enabled: false
sql.directory.query:
name:
type: <string>
value: <string>
threepid:
type: <string>
value: <string>
For each query, type
can be used to tell mxisd how to process the ID column:
localpart
will append thematrix.domain
to itmxid
will use the ID as-is. If it is not a valid Matrix ID, the search will fail.
value
is the SQL query and must return two columns:
- The first being the User ID
- The second being its display name
Example:
sql.directory.query:
name:
type: 'localpart'
value: 'SELECT idColumn, displayNameColumn FROM table WHERE displayNameColumn LIKE ?'
threepid:
type: 'localpart'
value: 'SELECT idColumn, displayNameColumn FROM table WHERE threepidColumn LIKE ?'
Identity
sql.identity.type: <string>
sql.identity.query: <string>