From 735a8dd998b2c0aebde9c96daefc7aa2c223218e Mon Sep 17 00:00:00 2001 From: href Date: Sat, 4 Sep 2021 05:41:09 +0200 Subject: matrix appservice, puppet improvements --- lib/lsg_web/router.ex | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/lsg_web/router.ex') diff --git a/lib/lsg_web/router.ex b/lib/lsg_web/router.ex index 5fcf0a8..dc49c9f 100644 --- a/lib/lsg_web/router.ex +++ b/lib/lsg_web/router.ex @@ -15,6 +15,12 @@ defmodule LSGWeb.Router do plug :accepts, ["json", "sse"] end + pipeline :matrix_app_service do + plug :accepts, ["json"] + plug LSG.Matrix.Plug.Auth + plug LSG.Matrix.Plug.SetConfig + end + scope "/api", LSGWeb do pipe_through :api get "/irc-auth.sse", IrcAuthSseController, :sse @@ -50,4 +56,20 @@ defmodule LSGWeb.Router do get "/:network/:chan/alcoolog/t/:token", AlcoologController, :token end + scope "/_matrix/appservice", MatrixAppServiceWeb.V1, as: :matrix do + pipe_through :matrix_app_service + + put "/transactions/:txn_id", TransactionController, :push + + get "/users/:user_id", UserController, :query + get "/rooms/:room_alias", RoomController, :query + + get "/thirdparty/protocol/:protocol", ThirdPartyController, :query_protocol + get "/thirdparty/user/:protocol", ThirdPartyController, :query_users + get "/thirdparty/location/:protocol", ThirdPartyController, :query_locations + get "/thirdparty/location", ThirdPartyController, :query_location_by_alias + get "/thirdparty/user", ThirdPartyController, :query_user_by_id + end + + end -- cgit v1.2.3