Documentation
¶
Index ¶
- Constants
- Variables
- func CreateXMatrixHeader(origin string, destination string, requestMethod string, requestUri string, ...) (string, error)
- func FederatedGet(ctx rcontext.RequestContext, reqUrl string, realHost string, ...) (*http.Response, error)
- func FlushSigningKeyCache()
- func GetServerApiUrl(hostname string) (string, string, error)
- func GetUserIdFromToken(ctx rcontext.RequestContext, serverName string, accessToken string, ...) (string, bool, error)
- func IsUserAdmin(ctx rcontext.RequestContext, serverName string, accessToken string, ...) (bool, error)
- func Logout(ctx rcontext.RequestContext, serverName string, accessToken string, ...) error
- func LogoutAll(ctx rcontext.RequestContext, serverName string, accessToken string, ...) error
- func NewHttpClient(ctx rcontext.RequestContext, clientConfig *HttpClientConfig) *http.Client
- func TestsOnlyInjectSigningKey(serverName string, httpFederationUrl string) error
- func ValidateXMatrixAuth(request *http.Request, expectNoContent bool) (string, error)
- func ValidateXMatrixAuthHeader(requestMethod string, requestUri string, content []byte, ...) error
- type ClientVersionsResponse
- type ErrorResponse
- type HttpClientConfig
- type LocalSigningKey
- type MediaListResponse
- type ServerKeyResult
- type ServerNotAllowedError
- type ServerSigningKeys
Constants ¶
View Source
const NoSigningKey = ""
Variables ¶
View Source
var ErrGuestToken = errors.New("token belongs to a guest")
View Source
var ErrInvalidToken = errors.New("missing or invalid access token")
View Source
var ErrNoXMatrixAuth = errors.New("no X-Matrix auth headers")
View Source
var ErrWrongDestination = errors.New("wrong destination")
Functions ¶
func CreateXMatrixHeader ¶ added in v1.3.5
func FederatedGet ¶
func FlushSigningKeyCache ¶ added in v1.3.5
func FlushSigningKeyCache()
func GetUserIdFromToken ¶
func IsUserAdmin ¶
func NewHttpClient ¶ added in v1.3.8
func NewHttpClient(ctx rcontext.RequestContext, clientConfig *HttpClientConfig) *http.Client
func TestsOnlyInjectSigningKey ¶ added in v1.3.5
TestsOnlyInjectSigningKey Deprecated: For tests only.
func ValidateXMatrixAuth ¶ added in v1.3.5
func ValidateXMatrixAuthHeader ¶ added in v1.3.5
func ValidateXMatrixAuthHeader(requestMethod string, requestUri string, content []byte, headers []util.XMatrixAuth, originKeys ServerSigningKeys, destinationHost string) error
Types ¶
type ClientVersionsResponse ¶ added in v1.3.5
type ClientVersionsResponse struct {
Versions []string `json:"versions"`
UnstableFeatures map[string]bool `json:"unstable_features"`
}
func ClientVersions ¶ added in v1.3.5
func ClientVersions(ctx rcontext.RequestContext, serverName string, accessToken string, appserviceUserId string, ipAddr string) (*ClientVersionsResponse, error)
type ErrorResponse ¶ added in v1.3.5
func (ErrorResponse) Error ¶ added in v1.3.5
func (e ErrorResponse) Error() string
type HttpClientConfig ¶ added in v1.3.8
type LocalSigningKey ¶ added in v1.3.5
type LocalSigningKey struct {
Key ed25519.PrivateKey
Version string
}
type MediaListResponse ¶
type MediaListResponse struct {
LocalMxcs []string `json:"local"`
RemoteMxcs []string `json:"remote"`
}
func ListMedia ¶
func ListMedia(ctx rcontext.RequestContext, serverName string, accessToken string, roomId string, ipAddr string) (*MediaListResponse, error)
type ServerKeyResult ¶ added in v1.3.5
type ServerKeyResult struct {
ServerName string `json:"server_name"`
ValidUntilTs int64 `json:"valid_until_ts"`
VerifyKeys map[string]signingKey `json:"verify_keys"` // unpadded base64
OldVerifyKeys map[string]signingKey `json:"old_verify_keys"` // unpadded base64
Signatures map[string]map[string]string `json:"signatures"` // unpadded base64; <name, <keyId, sig>>
}
type ServerNotAllowedError ¶ added in v1.3.5
type ServerNotAllowedError struct {
ServerName string
// contains filtered or unexported fields
}
func MakeServerNotAllowedError ¶ added in v1.3.5
func MakeServerNotAllowedError(serverName string) ServerNotAllowedError
type ServerSigningKeys ¶ added in v1.3.5
func CheckSigningKeySignatures ¶ added in v1.3.5
func CheckSigningKeySignatures(serverName string, keyInfo *ServerKeyResult, raw database.AnonymousJson) (ServerSigningKeys, error)
func QuerySigningKeys ¶ added in v1.3.5
func QuerySigningKeys(serverName string) (ServerSigningKeys, error)
Click to show internal directories.
Click to hide internal directories.