mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-13 01:43:09 -06:00
Initial structuring for URIToUID API
This commit is contained in:
parent
9cdd3a66e4
commit
25504f20f3
|
|
@ -51,11 +51,7 @@ func Setup(
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
appMux.Handle("/user",
|
appMux.Handle("/user",
|
||||||
common.MakeExternalAPI("user", func(req *http.Request) util.JSONResponse {
|
common.MakeExternalAPI("user", func(req *http.Request) util.JSONResponse {
|
||||||
// TODO: Implement
|
return URIToUID(req)
|
||||||
return util.JSONResponse{
|
|
||||||
Code: http.StatusOK,
|
|
||||||
JSON: nil,
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package routing
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/matrix-org/util"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// represents response to an AppService URI to User Id
|
||||||
|
// (/_matrix/app/r0/user?uri={url_encoded_uri}) request
|
||||||
|
type URIToUIDResponse struct {
|
||||||
|
UserID string `json:"user_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// URIToUID implements `/_matrix/app/r0/user?uri={url_encoded_uri}`, which
|
||||||
|
// enables users to contact appservice users directly by taking an encoded
|
||||||
|
// URI and turning it into a Matrix ID on the homeserver.
|
||||||
|
// https://matrix.org/docs/spec/application_service/unstable.html#user-ids
|
||||||
|
|
||||||
|
func URIToUID(req *http.Request) util.JSONResponse {
|
||||||
|
// TODO: Implement
|
||||||
|
return util.JSONResponse{
|
||||||
|
Code: http.StatusOK,
|
||||||
|
JSON: nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue