mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-10 08:23:11 -06:00
TODO
This commit is contained in:
parent
00688d3197
commit
5441738201
|
|
@ -38,7 +38,7 @@ func passwordLogin() loginFlows {
|
||||||
|
|
||||||
// Login implements GET and POST /login
|
// Login implements GET and POST /login
|
||||||
func Login(req *http.Request, cfg config.ClientAPI) util.JSONResponse {
|
func Login(req *http.Request, cfg config.ClientAPI) util.JSONResponse {
|
||||||
if req.Method == "GET" {
|
if req.Method == "GET" { // TODO: support other forms of login other than password, depending on config options
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 200,
|
Code: 200,
|
||||||
JSON: passwordLogin(),
|
JSON: passwordLogin(),
|
||||||
|
|
@ -55,6 +55,7 @@ func Login(req *http.Request, cfg config.ClientAPI) util.JSONResponse {
|
||||||
JSON: jsonerror.BadJSON("'user' must be supplied."),
|
JSON: jsonerror.BadJSON("'user' must be supplied."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// TODO: Check username and password properly
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 200,
|
Code: 200,
|
||||||
JSON: loginResponse{
|
JSON: loginResponse{
|
||||||
|
|
|
||||||
|
|
@ -47,14 +47,15 @@ func Setup(servMux *http.ServeMux, httpClient *http.Client, cfg config.ClientAPI
|
||||||
|
|
||||||
// Stub endpoints required by Riot
|
// Stub endpoints required by Riot
|
||||||
|
|
||||||
r0mux.Handle("/login", // TODO
|
r0mux.Handle("/login",
|
||||||
make("login", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
make("login", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
||||||
return readers.Login(req, cfg)
|
return readers.Login(req, cfg)
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
|
|
||||||
r0mux.Handle("/pushrules/", // TODO
|
r0mux.Handle("/pushrules/",
|
||||||
make("push_rules", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
make("push_rules", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
||||||
|
// TODO: Implement push rules API
|
||||||
res := json.RawMessage(`{
|
res := json.RawMessage(`{
|
||||||
"global": {
|
"global": {
|
||||||
"content": [],
|
"content": [],
|
||||||
|
|
@ -71,8 +72,9 @@ func Setup(servMux *http.ServeMux, httpClient *http.Client, cfg config.ClientAPI
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
|
|
||||||
r0mux.Handle("/user/{userID}/filter", // TODO
|
r0mux.Handle("/user/{userID}/filter",
|
||||||
make("make_filter", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
make("make_filter", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
||||||
|
// TODO: Persist filter and return filter ID
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 200,
|
Code: 200,
|
||||||
JSON: struct{}{},
|
JSON: struct{}{},
|
||||||
|
|
@ -80,8 +82,9 @@ func Setup(servMux *http.ServeMux, httpClient *http.Client, cfg config.ClientAPI
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
|
|
||||||
r0mux.Handle("/user/{userID}/filter/{filterID}", // TODO
|
r0mux.Handle("/user/{userID}/filter/{filterID}",
|
||||||
make("filter", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
make("filter", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
||||||
|
// TODO: Retrieve filter based on ID
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 200,
|
Code: 200,
|
||||||
JSON: struct{}{},
|
JSON: struct{}{},
|
||||||
|
|
@ -91,8 +94,9 @@ func Setup(servMux *http.ServeMux, httpClient *http.Client, cfg config.ClientAPI
|
||||||
|
|
||||||
// Riot user settings
|
// Riot user settings
|
||||||
|
|
||||||
r0mux.Handle("/profile/{userID}", // TODO
|
r0mux.Handle("/profile/{userID}",
|
||||||
make("profile", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
make("profile", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
||||||
|
// TODO: Get profile data for user ID
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 200,
|
Code: 200,
|
||||||
JSON: struct{}{},
|
JSON: struct{}{},
|
||||||
|
|
@ -100,8 +104,9 @@ func Setup(servMux *http.ServeMux, httpClient *http.Client, cfg config.ClientAPI
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
|
|
||||||
r0mux.Handle("/account/3pid", // TODO
|
r0mux.Handle("/account/3pid",
|
||||||
make("account_3pid", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
make("account_3pid", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
||||||
|
// TODO: Get 3pid data for user ID
|
||||||
res := json.RawMessage(`{"threepids":[]}`)
|
res := json.RawMessage(`{"threepids":[]}`)
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 200,
|
Code: 200,
|
||||||
|
|
@ -111,8 +116,9 @@ func Setup(servMux *http.ServeMux, httpClient *http.Client, cfg config.ClientAPI
|
||||||
)
|
)
|
||||||
|
|
||||||
// Riot logs get flooded unless this is handled
|
// Riot logs get flooded unless this is handled
|
||||||
r0mux.Handle("/presence/{userID}/status", // TODO
|
r0mux.Handle("/presence/{userID}/status",
|
||||||
make("presence", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
make("presence", util.NewJSONRequestHandler(func(req *http.Request) util.JSONResponse {
|
||||||
|
// TODO: Set presence (probably the responsibility of a presence server not clientapi)
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 200,
|
Code: 200,
|
||||||
JSON: struct{}{},
|
JSON: struct{}{},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue