mas: rename msc2965 to msc3861

This commit is contained in:
Roman Isaev 2024-12-22 00:35:04 +00:00
parent 2c47959600
commit e1dfe62b20
No known key found for this signature in database
GPG key ID: 7BE2B6A6C89AEC7F
3 changed files with 12 additions and 12 deletions

View file

@ -328,7 +328,7 @@ func Setup(
}, httputil.WithAllowGuests()), }, httputil.WithAllowGuests()),
).Methods(http.MethodPost, http.MethodOptions) ).Methods(http.MethodPost, http.MethodOptions)
if m := mscCfg.MSC2965; mscCfg.Enabled("msc2965") && m != nil && m.Enabled { if m := mscCfg.MSC3861; mscCfg.Enabled("msc3861") && m != nil && m.Enabled {
unstableMux.Handle("/org.matrix.msc2965/auth_issuer", unstableMux.Handle("/org.matrix.msc2965/auth_issuer",
httputil.MakeExternalAPI("auth_issuer", func(r *http.Request) util.JSONResponse { httputil.MakeExternalAPI("auth_issuer", func(r *http.Request) util.JSONResponse {
return util.JSONResponse{Code: http.StatusOK, JSON: map[string]string{ return util.JSONResponse{Code: http.StatusOK, JSON: map[string]string{

View file

@ -7,10 +7,10 @@ type MSCs struct {
// 'msc2444': Peeking over federation - https://github.com/matrix-org/matrix-doc/pull/2444 // '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 // 'msc2753': Peeking via /sync - https://github.com/matrix-org/matrix-doc/pull/2753
// 'msc2836': Threading - https://github.com/matrix-org/matrix-doc/pull/2836 // '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 // 'msc3861': Delegate auth to an OIDC provider https://github.com/matrix-org/matrix-spec-proposals/pull/3861
MSCs []string `yaml:"mscs"` MSCs []string `yaml:"mscs"`
MSC2965 *MSC2965 `yaml:"msc2965,omitempty"` MSC3861 *MSC3861 `yaml:"msc3861,omitempty"`
Database DatabaseOptions `yaml:"database,omitempty"` Database DatabaseOptions `yaml:"database,omitempty"`
} }
@ -37,12 +37,12 @@ func (c *MSCs) Verify(configErrs *ConfigErrors) {
if c.Matrix.DatabaseOptions.ConnectionString == "" { if c.Matrix.DatabaseOptions.ConnectionString == "" {
checkNotEmpty(configErrs, "mscs.database.connection_string", string(c.Database.ConnectionString)) checkNotEmpty(configErrs, "mscs.database.connection_string", string(c.Database.ConnectionString))
} }
if m := c.MSC2965; m != nil { if m := c.MSC3861; m != nil {
m.Verify(configErrs) m.Verify(configErrs)
} }
} }
type MSC2965 struct { type MSC3861 struct {
Enabled bool `yaml:"enabled"` Enabled bool `yaml:"enabled"`
Issuer string `yaml:"issuer"` Issuer string `yaml:"issuer"`
ClientID string `yaml:"client_id"` ClientID string `yaml:"client_id"`
@ -51,13 +51,13 @@ type MSC2965 struct {
AccountManagementURL string `yaml:"account_management_url"` AccountManagementURL string `yaml:"account_management_url"`
} }
func (m *MSC2965) Verify(configErrs *ConfigErrors) { func (m *MSC3861) Verify(configErrs *ConfigErrors) {
if !m.Enabled { if !m.Enabled {
return return
} }
checkNotEmpty(configErrs, "mscs.msc2965.issuer", string(m.Issuer)) checkNotEmpty(configErrs, "mscs.msc3861.issuer", string(m.Issuer))
checkNotEmpty(configErrs, "mscs.msc2965.client_id", string(m.ClientID)) checkNotEmpty(configErrs, "mscs.msc3861.client_id", string(m.ClientID))
checkNotEmpty(configErrs, "mscs.msc2965.client_secret", string(m.ClientSecret)) checkNotEmpty(configErrs, "mscs.msc3861.client_secret", string(m.ClientSecret))
checkNotEmpty(configErrs, "mscs.msc2965.admin_token", string(m.AdminToken)) checkNotEmpty(configErrs, "mscs.msc3861.admin_token", string(m.AdminToken))
checkNotEmpty(configErrs, "mscs.msc2965.account_management_url", string(m.AccountManagementURL)) checkNotEmpty(configErrs, "mscs.msc3861.account_management_url", string(m.AccountManagementURL))
} }

View file

@ -37,7 +37,7 @@ func EnableMSC(cfg *config.Dendrite, cm *sqlutil.Connections, routers httputil.R
return msc2836.Enable(cfg, cm, routers, monolith.RoomserverAPI, monolith.FederationAPI, monolith.UserAPI, monolith.KeyRing) return msc2836.Enable(cfg, cm, routers, monolith.RoomserverAPI, monolith.FederationAPI, monolith.UserAPI, monolith.KeyRing)
case "msc2444": // enabled inside federationapi case "msc2444": // enabled inside federationapi
case "msc2753": // enabled inside clientapi case "msc2753": // enabled inside clientapi
case "msc2965": // enabled inside clientapi case "msc3861": // enabled inside clientapi
default: default:
logrus.Warnf("EnableMSC: unknown MSC '%s', this MSC is either not supported or is natively supported by Dendrite", msc) logrus.Warnf("EnableMSC: unknown MSC '%s', this MSC is either not supported or is natively supported by Dendrite", msc)
} }