routing

package
v0.13.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTransactionFromRelay

func GetTransactionFromRelay(
	httpReq *http.Request,
	fedReq *fclient.FederationRequest,
	relayAPI api.RelayInternalAPI,
	userID spec.UserID,
) util.JSONResponse

GetTransactionFromRelay implements GET /_matrix/federation/v1/relay_txn/{userID} This endpoint can be extracted into a separate relay server service.

func MakeRelayAPI

func MakeRelayAPI(
	metricsName string, serverName spec.ServerName,
	isLocalServerName func(spec.ServerName) bool,
	keyRing gomatrixserverlib.JSONVerifier,
	f func(*http.Request, *fclient.FederationRequest, map[string]string) util.JSONResponse,
) http.Handler

MakeRelayAPI makes an http.Handler that checks matrix relay authentication.

func SendTransactionToRelay

func SendTransactionToRelay(
	httpReq *http.Request,
	fedReq *fclient.FederationRequest,
	relayAPI api.RelayInternalAPI,
	txnID gomatrixserverlib.TransactionID,
	userID spec.UserID,
) util.JSONResponse

SendTransactionToRelay implements PUT /_matrix/federation/v1/send_relay/{txnID}/{userID} This endpoint can be extracted into a separate relay server service.

func Setup

Setup registers HTTP handlers with the given ServeMux. The provided publicAPIMux MUST have `UseEncodedPath()` enabled or else routes will incorrectly path unescape twice (once from the router, once from MakeRelayAPI). We need to have this enabled so we can decode paths like foo/bar%2Fbaz as [foo, bar/baz] - by default it will decode to [foo, bar, baz]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL