mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 05:32:25 +03:00
mas: remove enabled field from msc3861 config + remove some incorrect comments
This commit is contained in:
parent
4cde3bafb1
commit
5ea033d1e4
2 changed files with 4 additions and 10 deletions
|
@ -285,13 +285,11 @@ media_api:
|
|||
# Configuration for enabling experimental MSCs on this homeserver.
|
||||
mscs:
|
||||
mscs:
|
||||
# - msc3861 # (Next-gen auth, see https://github.com/matrix-org/matrix-doc/pull/3861. MUST always go first in the list)
|
||||
# - msc3861 # (Next-gen auth, see https://github.com/matrix-org/matrix-doc/pull/3861)
|
||||
# - msc2836 # (Threading, see https://github.com/matrix-org/matrix-doc/pull/2836)
|
||||
|
||||
# This block has no effect if the feature is not activated in the list above
|
||||
# msc3861:
|
||||
# enabled: true
|
||||
|
||||
# # OIDC issuer advertised by the service.
|
||||
# # See https://element-hq.github.io/matrix-authentication-service/reference/configuration.html#http
|
||||
# issuer: "https://mas.example.com/"
|
||||
|
|
|
@ -6,7 +6,7 @@ type MSCs struct {
|
|||
Matrix *Global `yaml:"-"`
|
||||
|
||||
// The MSCs to enable. Supported MSCs include:
|
||||
// 'msc3861': Delegate auth to an OIDC provider. This line MUST always go first if the msc is used https://github.com/matrix-org/matrix-spec-proposals/pull/3861
|
||||
// 'msc3861': Delegate auth to an OIDC provider - https://github.com/matrix-org/matrix-spec-proposals/pull/3861
|
||||
// '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
|
||||
|
@ -40,17 +40,16 @@ func (c *MSCs) Verify(configErrs *ConfigErrors) {
|
|||
if c.Matrix.DatabaseOptions.ConnectionString == "" {
|
||||
checkNotEmpty(configErrs, "mscs.database.connection_string", string(c.Database.ConnectionString))
|
||||
}
|
||||
if m := c.MSC3861; m != nil {
|
||||
if m := c.MSC3861; m != nil && c.MSC3861Enabled() {
|
||||
m.Verify(configErrs)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *MSCs) MSC3861Enabled() bool {
|
||||
return slices.Contains(c.MSCs, "msc3861") && c.MSC3861 != nil && c.MSC3861.Enabled
|
||||
return slices.Contains(c.MSCs, "msc3861") && c.MSC3861 != nil
|
||||
}
|
||||
|
||||
type MSC3861 struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Issuer string `yaml:"issuer"`
|
||||
ClientID string `yaml:"client_id"`
|
||||
ClientSecret string `yaml:"client_secret"`
|
||||
|
@ -59,9 +58,6 @@ type MSC3861 struct {
|
|||
}
|
||||
|
||||
func (m *MSC3861) Verify(configErrs *ConfigErrors) {
|
||||
if !m.Enabled {
|
||||
return
|
||||
}
|
||||
checkNotEmpty(configErrs, "mscs.msc3861.issuer", string(m.Issuer))
|
||||
checkNotEmpty(configErrs, "mscs.msc3861.client_id", string(m.ClientID))
|
||||
checkNotEmpty(configErrs, "mscs.msc3861.client_secret", string(m.ClientSecret))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue