mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-16 06:02:24 +03:00
mas: added /auth_issuer endpoint
This commit is contained in:
parent
add73ec866
commit
ba542fedcd
3 changed files with 36 additions and 0 deletions
|
@ -7,8 +7,11 @@ type MSCs struct {
|
|||
// 'msc2444': Peeking over federation - https://github.com/matrix-org/matrix-doc/pull/2444
|
||||
// 'msc2753': Peeking via /sync - https://github.com/matrix-org/matrix-doc/pull/2753
|
||||
// 'msc2836': Threading - https://github.com/matrix-org/matrix-doc/pull/2836
|
||||
// 'msc2965': Delegate auth to an OIDC provider https://github.com/matrix-org/matrix-spec-proposals/pull/2965
|
||||
MSCs []string `yaml:"mscs"`
|
||||
|
||||
MSC2965 *MSC2965 `yaml:"msc2965,omitempty"`
|
||||
|
||||
Database DatabaseOptions `yaml:"database,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -34,4 +37,27 @@ func (c *MSCs) Verify(configErrs *ConfigErrors) {
|
|||
if c.Matrix.DatabaseOptions.ConnectionString == "" {
|
||||
checkNotEmpty(configErrs, "mscs.database.connection_string", string(c.Database.ConnectionString))
|
||||
}
|
||||
if m := c.MSC2965; m != nil {
|
||||
m.Verify(configErrs)
|
||||
}
|
||||
}
|
||||
|
||||
type MSC2965 struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Issuer string `yaml:"issuer"`
|
||||
ClientID string `yaml:"client_id"`
|
||||
ClientSecret string `yaml:"client_secret"`
|
||||
AdminToken string `yaml:"admin_token"`
|
||||
AccountManagementURL string `yaml:"account_management_url"`
|
||||
}
|
||||
|
||||
func (m *MSC2965) Verify(configErrs *ConfigErrors) {
|
||||
if !m.Enabled {
|
||||
return
|
||||
}
|
||||
checkNotEmpty(configErrs, "mscs.msc2965.issuer", string(m.Issuer))
|
||||
checkNotEmpty(configErrs, "mscs.msc2965.client_id", string(m.ClientID))
|
||||
checkNotEmpty(configErrs, "mscs.msc2965.client_secret", string(m.ClientSecret))
|
||||
checkNotEmpty(configErrs, "mscs.msc2965.admin_token", string(m.AdminToken))
|
||||
checkNotEmpty(configErrs, "mscs.msc2965.account_management_url", string(m.AccountManagementURL))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue