mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 11:41:38 +00:00
Mention unstable features in /_matrix/client/versions (#1710)
* Mention unstable features in /_matrix/client/versions * list enabled mscs * Don't update go.mod/go.sum * goimports Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
parent
534c29ab02
commit
dd1e31bee7
@ -62,13 +62,19 @@ func Setup(
|
|||||||
rateLimits := newRateLimits(&cfg.RateLimiting)
|
rateLimits := newRateLimits(&cfg.RateLimiting)
|
||||||
userInteractiveAuth := auth.NewUserInteractive(accountDB.GetAccountByPassword, cfg)
|
userInteractiveAuth := auth.NewUserInteractive(accountDB.GetAccountByPassword, cfg)
|
||||||
|
|
||||||
|
unstableFeatures := make(map[string]bool)
|
||||||
|
for _, msc := range cfg.MSCs.MSCs {
|
||||||
|
unstableFeatures["org.matrix."+msc] = true
|
||||||
|
}
|
||||||
|
|
||||||
publicAPIMux.Handle("/versions",
|
publicAPIMux.Handle("/versions",
|
||||||
httputil.MakeExternalAPI("versions", func(req *http.Request) util.JSONResponse {
|
httputil.MakeExternalAPI("versions", func(req *http.Request) util.JSONResponse {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusOK,
|
Code: http.StatusOK,
|
||||||
JSON: struct {
|
JSON: struct {
|
||||||
Versions []string `json:"versions"`
|
Versions []string `json:"versions"`
|
||||||
}{[]string{
|
UnstableFeatures map[string]bool `json:"unstable_features"`
|
||||||
|
}{Versions: []string{
|
||||||
"r0.0.1",
|
"r0.0.1",
|
||||||
"r0.1.0",
|
"r0.1.0",
|
||||||
"r0.2.0",
|
"r0.2.0",
|
||||||
@ -76,7 +82,7 @@ func Setup(
|
|||||||
"r0.4.0",
|
"r0.4.0",
|
||||||
"r0.5.0",
|
"r0.5.0",
|
||||||
"r0.6.1",
|
"r0.6.1",
|
||||||
}},
|
}, UnstableFeatures: unstableFeatures},
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
|
@ -344,6 +344,7 @@ func (c *Dendrite) Wiring() {
|
|||||||
|
|
||||||
c.ClientAPI.Derived = &c.Derived
|
c.ClientAPI.Derived = &c.Derived
|
||||||
c.AppServiceAPI.Derived = &c.Derived
|
c.AppServiceAPI.Derived = &c.Derived
|
||||||
|
c.ClientAPI.MSCs = &c.MSCs
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error returns a string detailing how many errors were contained within a
|
// Error returns a string detailing how many errors were contained within a
|
||||||
|
@ -37,6 +37,8 @@ type ClientAPI struct {
|
|||||||
|
|
||||||
// Rate-limiting options
|
// Rate-limiting options
|
||||||
RateLimiting RateLimiting `yaml:"rate_limiting"`
|
RateLimiting RateLimiting `yaml:"rate_limiting"`
|
||||||
|
|
||||||
|
MSCs *MSCs `yaml:"mscs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ClientAPI) Defaults() {
|
func (c *ClientAPI) Defaults() {
|
||||||
|
Loading…
Reference in New Issue
Block a user