Documentation ¶
Index ¶
- Constants
- type Account
- type AccountType
- type AppserviceUserAPI
- type ClientUserAPI
- type Conflict
- type Device
- type ErrorConflict
- type ErrorForbidden
- type FederationUserAPI
- type InputAccountDataRequest
- type InputAccountDataResponse
- type InternalKeyBackupSession
- type KeyBackupSession
- type KeyserverUserAPI
- type LoginTokenData
- type LoginTokenInternalAPI
- type LoginTokenMetadata
- type MediaUserAPI
- type Notification
- type OpenIDToken
- type OpenIDTokenAttributes
- type PerformAccountCreationRequest
- type PerformAccountCreationResponse
- type PerformAccountDeactivationRequest
- type PerformAccountDeactivationResponse
- type PerformDeviceCreationRequest
- type PerformDeviceCreationResponse
- type PerformDeviceDeletionRequest
- type PerformDeviceDeletionResponse
- type PerformDeviceUpdateRequest
- type PerformDeviceUpdateResponse
- type PerformForgetThreePIDRequest
- type PerformKeyBackupRequest
- type PerformKeyBackupResponse
- type PerformLastSeenUpdateRequest
- type PerformLastSeenUpdateResponse
- type PerformLoginTokenCreationRequest
- type PerformLoginTokenCreationResponse
- type PerformLoginTokenDeletionRequest
- type PerformLoginTokenDeletionResponse
- type PerformOpenIDTokenCreationRequest
- type PerformOpenIDTokenCreationResponse
- type PerformPasswordUpdateRequest
- type PerformPasswordUpdateResponse
- type PerformPushRulesPutRequest
- type PerformPusherDeletionRequest
- type PerformPusherSetRequest
- type PerformSaveThreePIDAssociationRequest
- type PerformSetAvatarURLRequest
- type PerformSetAvatarURLResponse
- type PerformUpdateDisplayNameRequest
- type Pusher
- type PusherKind
- type QueryAcccessTokenAPI
- type QueryAccessTokenRequest
- type QueryAccessTokenResponse
- type QueryAccountAvailabilityRequest
- type QueryAccountAvailabilityResponse
- type QueryAccountByPasswordRequest
- type QueryAccountByPasswordResponse
- type QueryAccountDataRequest
- type QueryAccountDataResponse
- type QueryDeviceInfosRequest
- type QueryDeviceInfosResponse
- type QueryDevicesRequest
- type QueryDevicesResponse
- type QueryKeyBackupRequest
- type QueryKeyBackupResponse
- type QueryLocalpartForThreePIDRequest
- type QueryLocalpartForThreePIDResponse
- type QueryLoginTokenRequest
- type QueryLoginTokenResponse
- type QueryNotificationsRequest
- type QueryNotificationsResponse
- type QueryNumericLocalpartResponse
- type QueryOpenIDTokenRequest
- type QueryOpenIDTokenResponse
- type QueryProfileRequest
- type QueryProfileResponse
- type QueryPushRulesRequest
- type QueryPushRulesResponse
- type QueryPushersRequest
- type QueryPushersResponse
- type QuerySearchProfilesAPI
- type QuerySearchProfilesRequest
- type QuerySearchProfilesResponse
- type QueryThreePIDsForLocalpartRequest
- type QueryThreePIDsForLocalpartResponse
- type RoomserverUserAPI
- type SyncUserAPI
- type UserInfo
- type UserInternalAPI
- type UserInternalAPITrace
- func (t *UserInternalAPITrace) AddTelNumbers(ctx context.Context, localpart string, telNums []int64) (err error)
- func (t *UserInternalAPITrace) InputAccountData(ctx context.Context, req *InputAccountDataRequest, ...) error
- func (t *UserInternalAPITrace) InsertAddressBook(ctx context.Context, localpart string, friendLocalpart []string) (err error)
- func (t *UserInternalAPITrace) InsertChainData(ctx context.Context, localpart string, servername string, chatFee string, ...) (err error)
- func (t *UserInternalAPITrace) InsertRelationInvite(ctx context.Context, inviter string, invitee string, presentFee string) (err error)
- func (t *UserInternalAPITrace) JudgeShouldAutoJoin(ctx context.Context, inviter, invitee string) (bool, error)
- func (t *UserInternalAPITrace) PerformAccountCreation(ctx context.Context, req *PerformAccountCreationRequest, ...) error
- func (t *UserInternalAPITrace) PerformAccountDeactivation(ctx context.Context, req *PerformAccountDeactivationRequest, ...) error
- func (t *UserInternalAPITrace) PerformDeviceCreation(ctx context.Context, req *PerformDeviceCreationRequest, ...) error
- func (t *UserInternalAPITrace) PerformDeviceDeletion(ctx context.Context, req *PerformDeviceDeletionRequest, ...) error
- func (t *UserInternalAPITrace) PerformDeviceUpdate(ctx context.Context, req *PerformDeviceUpdateRequest, ...) error
- func (t *UserInternalAPITrace) PerformForgetThreePID(ctx context.Context, req *PerformForgetThreePIDRequest, res *struct{}) error
- func (t *UserInternalAPITrace) PerformKeyBackup(ctx context.Context, req *PerformKeyBackupRequest, ...) error
- func (t *UserInternalAPITrace) PerformLastSeenUpdate(ctx context.Context, req *PerformLastSeenUpdateRequest, ...) error
- func (t *UserInternalAPITrace) PerformLoginTokenCreation(ctx context.Context, req *PerformLoginTokenCreationRequest, ...) error
- func (t *UserInternalAPITrace) PerformLoginTokenDeletion(ctx context.Context, req *PerformLoginTokenDeletionRequest, ...) error
- func (t *UserInternalAPITrace) PerformOpenIDTokenCreation(ctx context.Context, req *PerformOpenIDTokenCreationRequest, ...) error
- func (t *UserInternalAPITrace) PerformPasswordUpdate(ctx context.Context, req *PerformPasswordUpdateRequest, ...) error
- func (t *UserInternalAPITrace) PerformPushRulesPut(ctx context.Context, req *PerformPushRulesPutRequest, res *struct{}) error
- func (t *UserInternalAPITrace) PerformPusherDeletion(ctx context.Context, req *PerformPusherDeletionRequest, res *struct{}) error
- func (t *UserInternalAPITrace) PerformPusherSet(ctx context.Context, req *PerformPusherSetRequest, res *struct{}) error
- func (t *UserInternalAPITrace) PerformSaveThreePIDAssociation(ctx context.Context, req *PerformSaveThreePIDAssociationRequest, res *struct{}) error
- func (t *UserInternalAPITrace) QueryAccessToken(ctx context.Context, req *QueryAccessTokenRequest, ...) error
- func (t *UserInternalAPITrace) QueryAccountAvailability(ctx context.Context, req *QueryAccountAvailabilityRequest, ...) error
- func (t *UserInternalAPITrace) QueryAccountByPassword(ctx context.Context, req *QueryAccountByPasswordRequest, ...) error
- func (t *UserInternalAPITrace) QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, ...) error
- func (t *UserInternalAPITrace) QueryDeviceInfos(ctx context.Context, req *QueryDeviceInfosRequest, ...) error
- func (t *UserInternalAPITrace) QueryDevices(ctx context.Context, req *QueryDevicesRequest, res *QueryDevicesResponse) error
- func (t *UserInternalAPITrace) QueryKeyBackup(ctx context.Context, req *QueryKeyBackupRequest, res *QueryKeyBackupResponse)
- func (t *UserInternalAPITrace) QueryLocalpartForThreePID(ctx context.Context, req *QueryLocalpartForThreePIDRequest, ...) error
- func (t *UserInternalAPITrace) QueryLoginToken(ctx context.Context, req *QueryLoginTokenRequest, res *QueryLoginTokenResponse) error
- func (t *UserInternalAPITrace) QueryNotifications(ctx context.Context, req *QueryNotificationsRequest, ...) error
- func (t *UserInternalAPITrace) QueryNumericLocalpart(ctx context.Context, res *QueryNumericLocalpartResponse) error
- func (t *UserInternalAPITrace) QueryOpenIDToken(ctx context.Context, req *QueryOpenIDTokenRequest, ...) error
- func (t *UserInternalAPITrace) QueryProfile(ctx context.Context, req *QueryProfileRequest, res *QueryProfileResponse) error
- func (t *UserInternalAPITrace) QueryPushRules(ctx context.Context, req *QueryPushRulesRequest, res *QueryPushRulesResponse) error
- func (t *UserInternalAPITrace) QueryPushers(ctx context.Context, req *QueryPushersRequest, res *QueryPushersResponse) error
- func (t *UserInternalAPITrace) QuerySearchProfiles(ctx context.Context, req *QuerySearchProfilesRequest, ...) error
- func (t *UserInternalAPITrace) QueryThreePIDsForLocalpart(ctx context.Context, req *QueryThreePIDsForLocalpartRequest, ...) error
- func (t *UserInternalAPITrace) SelectChainData(ctx context.Context, localpart string) (*types2.UserChainInfo, error)
- func (t *UserInternalAPITrace) SetAvatarURL(ctx context.Context, req *PerformSetAvatarURLRequest, ...) error
- func (t *UserInternalAPITrace) SetChatFee(ctx context.Context, localpart string, chatFee string) (err error)
- func (t *UserInternalAPITrace) SetDisplayName(ctx context.Context, req *PerformUpdateDisplayNameRequest, res *struct{}) error
- func (t *UserInternalAPITrace) SetMortgageFee(ctx context.Context, localpart string, mortgageFee string) (err error)
- type UserLoginAPI
Constants ¶
const ( // ConflictUpdate will update matching records returning no error ConflictUpdate Conflict = 1 // ConflictAbort will reject the request with ErrorConflict ConflictAbort Conflict = 2 // AccountTypeUser indicates this is a user account AccountTypeUser AccountType = 1 // AccountTypeGuest indicates this is a guest account AccountTypeGuest AccountType = 2 // AccountTypeAdmin indicates this is an admin account AccountTypeAdmin AccountType = 3 // AccountTypeAppService indicates this is an appservice account AccountTypeAppService AccountType = 4 )
const DefaultLoginTokenLifetime = 2 * time.Minute
NOTSPEC: The current spec says "SHOULD be limited to around five seconds". Since TCP retries are on the order of 3 s, 5 s sounds very low. Synapse uses 2 min (https://github.com/matrix-org/synapse/blob/78d5f91de1a9baf4dbb0a794cb49a799f29f7a38/synapse/handlers/auth.py#L1323-L1325).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { UserID string Localpart string ServerName gomatrixserverlib.ServerName AppServiceID string AccountType AccountType }
Account represents a Matrix account on this home server.
type AppserviceUserAPI ¶
type AppserviceUserAPI interface { PerformAccountCreation(ctx context.Context, req *PerformAccountCreationRequest, res *PerformAccountCreationResponse) error PerformDeviceCreation(ctx context.Context, req *PerformDeviceCreationRequest, res *PerformDeviceCreationResponse) error }
api functions required by the appservice api
type ClientUserAPI ¶
type ClientUserAPI interface { QueryAcccessTokenAPI LoginTokenInternalAPI UserLoginAPI QueryNumericLocalpart(ctx context.Context, res *QueryNumericLocalpartResponse) error QueryDevices(ctx context.Context, req *QueryDevicesRequest, res *QueryDevicesResponse) error QueryProfile(ctx context.Context, req *QueryProfileRequest, res *QueryProfileResponse) error QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, res *QueryAccountDataResponse) error QueryPushers(ctx context.Context, req *QueryPushersRequest, res *QueryPushersResponse) error QueryPushRules(ctx context.Context, req *QueryPushRulesRequest, res *QueryPushRulesResponse) error QueryAccountAvailability(ctx context.Context, req *QueryAccountAvailabilityRequest, res *QueryAccountAvailabilityResponse) error PerformAccountCreation(ctx context.Context, req *PerformAccountCreationRequest, res *PerformAccountCreationResponse) error PerformDeviceCreation(ctx context.Context, req *PerformDeviceCreationRequest, res *PerformDeviceCreationResponse) error PerformDeviceUpdate(ctx context.Context, req *PerformDeviceUpdateRequest, res *PerformDeviceUpdateResponse) error PerformDeviceDeletion(ctx context.Context, req *PerformDeviceDeletionRequest, res *PerformDeviceDeletionResponse) error PerformPasswordUpdate(ctx context.Context, req *PerformPasswordUpdateRequest, res *PerformPasswordUpdateResponse) error PerformPusherDeletion(ctx context.Context, req *PerformPusherDeletionRequest, res *struct{}) error PerformPusherSet(ctx context.Context, req *PerformPusherSetRequest, res *struct{}) error PerformPushRulesPut(ctx context.Context, req *PerformPushRulesPutRequest, res *struct{}) error PerformAccountDeactivation(ctx context.Context, req *PerformAccountDeactivationRequest, res *PerformAccountDeactivationResponse) error PerformOpenIDTokenCreation(ctx context.Context, req *PerformOpenIDTokenCreationRequest, res *PerformOpenIDTokenCreationResponse) error SetAvatarURL(ctx context.Context, req *PerformSetAvatarURLRequest, res *PerformSetAvatarURLResponse) error SetDisplayName(ctx context.Context, req *PerformUpdateDisplayNameRequest, res *struct{}) error QueryNotifications(ctx context.Context, req *QueryNotificationsRequest, res *QueryNotificationsResponse) error InputAccountData(ctx context.Context, req *InputAccountDataRequest, res *InputAccountDataResponse) error PerformKeyBackup(ctx context.Context, req *PerformKeyBackupRequest, res *PerformKeyBackupResponse) error QueryKeyBackup(ctx context.Context, req *QueryKeyBackupRequest, res *QueryKeyBackupResponse) JudgeShouldAutoJoin(ctx context.Context, inviter, invitee string) (bool, error) InsertRelationInvite(ctx context.Context, inviter string, invitee string, presentFee string) (err error) InsertChainData(ctx context.Context, localpart string, servername string, chatFee string, mortgageFee string) (err error) SelectChainData(ctx context.Context, localpart string) (*types2.UserChainInfo, error) SetMortgageFee(ctx context.Context, localpart string, mortgageFee string) (err error) SetChatFee(ctx context.Context, localpart string, chatFee string) (err error) InsertAddressBook(ctx context.Context, localpart string, friendLocalpart []string) (err error) AddTelNumbers(ctx context.Context, localpart string, telNums []int64) (err error) QueryThreePIDsForLocalpart(ctx context.Context, req *QueryThreePIDsForLocalpartRequest, res *QueryThreePIDsForLocalpartResponse) error QueryLocalpartForThreePID(ctx context.Context, req *QueryLocalpartForThreePIDRequest, res *QueryLocalpartForThreePIDResponse) error PerformForgetThreePID(ctx context.Context, req *PerformForgetThreePIDRequest, res *struct{}) error PerformSaveThreePIDAssociation(ctx context.Context, req *PerformSaveThreePIDAssociationRequest, res *struct{}) error }
api functions required by the client api
type Conflict ¶
type Conflict int
Conflict is an enum representing what to do when encountering conflicting when creating profiles/devices
type Device ¶
type Device struct { ID string UserID string // The access_token granted to this device. // This uniquely identifies the device from all other devices and clients. AccessToken string // The unique ID of the session identified by the access token. // Can be used as a secure substitution in places where data needs to be // associated with access tokens. SessionID int64 DisplayName string LastSeenTS int64 LastSeenIP string UserAgent string // If the device is for an appservice user, // this is the appservice ID. AppserviceID string AccountType AccountType }
Device represents a client's device (mobile, web, etc)
type ErrorConflict ¶
type ErrorConflict struct {
Message string
}
ErrorConflict is an error indicating that there was a conflict which resulted in the request being aborted.
func (*ErrorConflict) Error ¶
func (e *ErrorConflict) Error() string
type ErrorForbidden ¶
type ErrorForbidden struct {
Message string
}
ErrorForbidden is an error indicating that the supplied access token is forbidden
func (*ErrorForbidden) Error ¶
func (e *ErrorForbidden) Error() string
type FederationUserAPI ¶
type FederationUserAPI interface { QueryOpenIDToken(ctx context.Context, req *QueryOpenIDTokenRequest, res *QueryOpenIDTokenResponse) error QueryProfile(ctx context.Context, req *QueryProfileRequest, res *QueryProfileResponse) error }
api functions required by the federation api
type InputAccountDataRequest ¶
type InputAccountDataRequest struct { UserID string // required: the user to set account data for RoomID string // optional: the room to associate the account data with DataType string // required: the data type of the data AccountData json.RawMessage // required: the message content }
InputAccountDataRequest is the request for InputAccountData
type InputAccountDataResponse ¶
type InputAccountDataResponse struct { }
InputAccountDataResponse is the response for InputAccountData
type InternalKeyBackupSession ¶
type InternalKeyBackupSession struct { KeyBackupSession RoomID string SessionID string }
Internal KeyBackupData for passing to/from the storage layer
type KeyBackupSession ¶
type KeyBackupSession struct { FirstMessageIndex int `json:"first_message_index"` ForwardedCount int `json:"forwarded_count"` IsVerified bool `json:"is_verified"` SessionData json.RawMessage `json:"session_data"` }
KeyBackupData in https://spec.matrix.org/unstable/client-server-api/#get_matrixclientr0room_keyskeysroomidsessionid
func (*KeyBackupSession) ShouldReplaceRoomKey ¶
func (a *KeyBackupSession) ShouldReplaceRoomKey(newKey *KeyBackupSession) bool
type KeyserverUserAPI ¶
type KeyserverUserAPI interface { QueryDevices(ctx context.Context, req *QueryDevicesRequest, res *QueryDevicesResponse) error QueryDeviceInfos(ctx context.Context, req *QueryDeviceInfosRequest, res *QueryDeviceInfosResponse) error }
type LoginTokenData ¶
type LoginTokenData struct { // UserID is the full mxid of the user. UserID string }
LoginTokenData is the data that can be retrieved given a login token. This is provided by the calling code.
type LoginTokenInternalAPI ¶
type LoginTokenInternalAPI interface { // PerformLoginTokenCreation creates a new login token and associates it with the provided data. PerformLoginTokenCreation(ctx context.Context, req *PerformLoginTokenCreationRequest, res *PerformLoginTokenCreationResponse) error // PerformLoginTokenDeletion ensures the token doesn't exist. Success // is returned even if the token didn't exist, or was already deleted. PerformLoginTokenDeletion(ctx context.Context, req *PerformLoginTokenDeletionRequest, res *PerformLoginTokenDeletionResponse) error // QueryLoginToken returns the data associated with a login token. If // the token is not valid, success is returned, but res.Data == nil. QueryLoginToken(ctx context.Context, req *QueryLoginTokenRequest, res *QueryLoginTokenResponse) error }
type LoginTokenMetadata ¶
LoginTokenMetadata contains metadata created and maintained by the User API.
type MediaUserAPI ¶
type MediaUserAPI interface { QueryAcccessTokenAPI }
api functions required by the media api
type Notification ¶
type Notification struct { Actions []*pushrules.Action `json:"actions"` // Required. Event gomatrixserverlib.ClientEvent `json:"event"` // Required. ProfileTag string `json:"profile_tag"` // Required by Sytest, but actually optional. Read bool `json:"read"` // Required. RoomID string `json:"room_id"` // Required. TS gomatrixserverlib.Timestamp `json:"ts"` // Required. }
type OpenIDToken ¶
OpenIDToken represents an OpenID token
type OpenIDTokenAttributes ¶
OpenIDTokenInfo represents the attributes associated with an issued OpenID token
type PerformAccountCreationRequest ¶
type PerformAccountCreationRequest struct { AccountType AccountType // Required: whether this is a guest or user account Localpart string // Required: The localpart for this account. Ignored if account type is guest. AppServiceID string // optional: the application service ID (not user ID) creating this account, if any. Password string // optional: if missing then this account will be a passwordless account OnConflict Conflict }
PerformAccountCreationRequest is the request for PerformAccountCreation
type PerformAccountCreationResponse ¶
PerformAccountCreationResponse is the response for PerformAccountCreation
type PerformAccountDeactivationRequest ¶
type PerformAccountDeactivationRequest struct {
Localpart string
}
PerformAccountDeactivationRequest is the request for PerformAccountDeactivation
type PerformAccountDeactivationResponse ¶
type PerformAccountDeactivationResponse struct {
AccountDeactivated bool
}
PerformAccountDeactivationResponse is the response for PerformAccountDeactivation
type PerformDeviceCreationRequest ¶
type PerformDeviceCreationRequest struct { Localpart string AccessToken string // optional: if blank one will be made on your behalf // optional: if nil an ID is generated for you. If set, replaces any existing device session, // which will generate a new access token and invalidate the old one. DeviceID *string // optional: if nil no display name will be associated with this device. DeviceDisplayName *string // IP address of this device IPAddr string // Useragent for this device UserAgent string // NoDeviceListUpdate determines whether we should avoid sending a device list // update for this account. Generally the only reason to do this is if the account // is an appservice account. NoDeviceListUpdate bool }
PerformDeviceCreationRequest is the request for PerformDeviceCreation
type PerformDeviceCreationResponse ¶
PerformDeviceCreationResponse is the response for PerformDeviceCreation
type PerformDeviceDeletionRequest ¶
type PerformDeviceDeletionRequest struct { UserID string // The devices to delete. An empty slice means delete all devices. DeviceIDs []string // The requesting device ID to exclude from deletion. This is needed // so that a password change doesn't cause that client to be logged // out. Only specify when DeviceIDs is empty. ExceptDeviceID string }
type PerformDeviceDeletionResponse ¶
type PerformDeviceDeletionResponse struct { }
type PerformForgetThreePIDRequest ¶
type PerformForgetThreePIDRequest QueryLocalpartForThreePIDRequest
type PerformKeyBackupRequest ¶
type PerformKeyBackupRequest struct { UserID string Version string // optional if modifying a key backup AuthData json.RawMessage Algorithm string DeleteBackup bool // if true will delete the backup based on 'Version'. // The keys to upload, if any. If blank, creates/updates/deletes key version metadata only. Keys struct { Rooms map[string]struct { Sessions map[string]KeyBackupSession `json:"sessions"` } `json:"rooms"` } }
type PerformKeyBackupResponse ¶
type PerformKeyBackupResponse struct { Error string // set if there was a problem performing the request BadInput bool // if set, the Error was due to bad input (HTTP 400) Exists bool // set to true if the Version exists Version string // the newly created version KeyCount int64 // only set if Keys were given in the request KeyETag string // only set if Keys were given in the request }
type PerformLastSeenUpdateRequest ¶
type PerformLastSeenUpdateRequest struct { UserID string DeviceID string RemoteAddr string UserAgent string }
PerformLastSeenUpdateRequest is the request for PerformLastSeenUpdate.
type PerformLastSeenUpdateResponse ¶
type PerformLastSeenUpdateResponse struct { }
PerformLastSeenUpdateResponse is the response for PerformLastSeenUpdate.
type PerformLoginTokenCreationRequest ¶
type PerformLoginTokenCreationRequest struct {
Data LoginTokenData
}
type PerformLoginTokenCreationResponse ¶
type PerformLoginTokenCreationResponse struct {
Metadata LoginTokenMetadata
}
type PerformLoginTokenDeletionRequest ¶
type PerformLoginTokenDeletionRequest struct {
Token string
}
type PerformLoginTokenDeletionResponse ¶
type PerformLoginTokenDeletionResponse struct{}
type PerformOpenIDTokenCreationRequest ¶
type PerformOpenIDTokenCreationRequest struct {
UserID string
}
PerformOpenIDTokenCreationRequest is the request for PerformOpenIDTokenCreation
type PerformOpenIDTokenCreationResponse ¶
type PerformOpenIDTokenCreationResponse struct {
Token OpenIDToken
}
PerformOpenIDTokenCreationResponse is the response for PerformOpenIDTokenCreation
type PerformPasswordUpdateRequest ¶
type PerformPasswordUpdateRequest struct { Localpart string // Required: The localpart for this account. Password string // Required: The new password to set. }
PerformAccountCreationRequest is the request for PerformAccountCreation
type PerformPasswordUpdateResponse ¶
PerformAccountCreationResponse is the response for PerformAccountCreation
type PerformPushRulesPutRequest ¶
type PerformPushRulesPutRequest struct { UserID string `json:"user_id"` RuleSets *pushrules.AccountRuleSets `json:"rule_sets"` }
type PerformPusherSetRequest ¶
type PerformSaveThreePIDAssociationRequest ¶
type PerformSaveThreePIDAssociationRequest struct {
ThreePID, Localpart, Medium string
}
type PerformSetAvatarURLRequest ¶
type PerformSetAvatarURLRequest struct {
Localpart, AvatarURL string
}
type PerformSetAvatarURLResponse ¶
type PerformSetAvatarURLResponse struct{}
type PerformUpdateDisplayNameRequest ¶
type PerformUpdateDisplayNameRequest struct {
Localpart, DisplayName string
}
type Pusher ¶
type Pusher struct { SessionID int64 `json:"session_id,omitempty"` PushKey string `json:"pushkey"` PushKeyTS int64 `json:"pushkey_ts,omitempty"` Kind PusherKind `json:"kind"` AppID string `json:"app_id"` AppDisplayName string `json:"app_display_name"` DeviceDisplayName string `json:"device_display_name"` ProfileTag string `json:"profile_tag"` Language string `json:"lang"` Data map[string]interface{} `json:"data"` }
Pusher represents a push notification subscriber
type PusherKind ¶
type PusherKind string
const ( EmailKind PusherKind = "email" HTTPKind PusherKind = "http" )
type QueryAcccessTokenAPI ¶
type QueryAcccessTokenAPI interface {
QueryAccessToken(ctx context.Context, req *QueryAccessTokenRequest, res *QueryAccessTokenResponse) error
}
common function for creating authenticated endpoints (used in client/media/sync api)
type QueryAccessTokenRequest ¶
type QueryAccessTokenRequest struct { AccessToken string // optional user ID, valid only if the token is an appservice. // https://matrix.org/docs/spec/application_service/r0.1.2#using-sync-and-events AppServiceUserID string }
QueryAccessTokenRequest is the request for QueryAccessToken
type QueryAccessTokenResponse ¶
QueryAccessTokenResponse is the response for QueryAccessToken
type QueryAccountAvailabilityRequest ¶
type QueryAccountAvailabilityRequest struct {
Localpart string
}
type QueryAccountAvailabilityResponse ¶
type QueryAccountAvailabilityResponse struct {
Available bool
}
type QueryAccountByPasswordRequest ¶
type QueryAccountByPasswordRequest struct {
Localpart, PlaintextPassword string
}
type QueryAccountDataRequest ¶
type QueryAccountDataRequest struct { UserID string // required: the user to get account data for. RoomID string // optional: the room ID, or global account data if not specified. DataType string // optional: the data type, or all types if not specified. }
QueryAccountDataRequest is the request for QueryAccountData
type QueryAccountDataResponse ¶
type QueryAccountDataResponse struct { GlobalAccountData map[string]json.RawMessage // type -> data RoomAccountData map[string]map[string]json.RawMessage // room -> type -> data }
QueryAccountDataResponse is the response for QueryAccountData
type QueryDeviceInfosRequest ¶
type QueryDeviceInfosRequest struct {
DeviceIDs []string
}
QueryDeviceInfosRequest is the request to QueryDeviceInfos
type QueryDeviceInfosResponse ¶
type QueryDeviceInfosResponse struct { DeviceInfo map[string]struct { DisplayName string UserID string } }
QueryDeviceInfosResponse is the response to QueryDeviceInfos
type QueryDevicesRequest ¶
type QueryDevicesRequest struct {
UserID string
}
QueryDevicesRequest is the request for QueryDevices
type QueryDevicesResponse ¶
QueryDevicesResponse is the response for QueryDevices
type QueryKeyBackupRequest ¶
type QueryKeyBackupRequest struct { UserID string Version string // the version to query, if blank it means the latest ReturnKeys bool // whether to return keys in the backup response or just the metadata KeysForRoomID string // optional string to return keys which belong to this room KeysForSessionID string // optional string to return keys which belong to this (room, session) }
type QueryKeyBackupResponse ¶
type QueryKeyBackupResponse struct { Error string Exists bool Algorithm string `json:"algorithm"` AuthData json.RawMessage `json:"auth_data"` Count int64 `json:"count"` ETag string `json:"etag"` Version string `json:"version"` Keys map[string]map[string]KeyBackupSession // the keys if ReturnKeys=true }
type QueryLocalpartForThreePIDRequest ¶
type QueryLocalpartForThreePIDRequest struct {
ThreePID, Medium string
}
type QueryLocalpartForThreePIDResponse ¶
type QueryLocalpartForThreePIDResponse struct {
Localpart string
}
type QueryLoginTokenRequest ¶
type QueryLoginTokenRequest struct {
Token string
}
type QueryLoginTokenResponse ¶
type QueryLoginTokenResponse struct { // Data is nil if the token was invalid. Data *LoginTokenData }
type QueryNotificationsResponse ¶
type QueryNotificationsResponse struct { NextToken string `json:"next_token"` Notifications []*Notification `json:"notifications"` // Required. }
type QueryNumericLocalpartResponse ¶
type QueryNumericLocalpartResponse struct {
ID int64
}
type QueryOpenIDTokenRequest ¶
type QueryOpenIDTokenRequest struct {
Token string
}
QueryOpenIDTokenRequest is the request for QueryOpenIDToken
type QueryOpenIDTokenResponse ¶
type QueryOpenIDTokenResponse struct { Sub string // The Matrix User ID that generated the token ExpiresAtMS int64 }
QueryOpenIDTokenResponse is the response for QueryOpenIDToken
type QueryProfileRequest ¶
type QueryProfileRequest struct { // The user ID to query UserID string }
QueryProfileRequest is the request for QueryProfile
type QueryProfileResponse ¶
type QueryProfileResponse struct { // True if the user exists. Querying for a profile does not create them. UserExists bool // The current display name if set. DisplayName string // The current avatar URL if set. AvatarURL string TelNumbers []int64 `json:"tel_numbers"` MortgageFee string `json:"mortgage_fee"` }
QueryProfileResponse is the response for QueryProfile
type QueryPushRulesRequest ¶
type QueryPushRulesRequest struct {
UserID string `json:"user_id"`
}
type QueryPushRulesResponse ¶
type QueryPushRulesResponse struct {
RuleSets *pushrules.AccountRuleSets `json:"rule_sets"`
}
type QueryPushersRequest ¶
type QueryPushersRequest struct {
Localpart string
}
type QueryPushersResponse ¶
type QueryPushersResponse struct {
Pushers []Pusher `json:"pushers"`
}
type QuerySearchProfilesAPI ¶
type QuerySearchProfilesAPI interface {
QuerySearchProfiles(ctx context.Context, req *QuerySearchProfilesRequest, res *QuerySearchProfilesResponse) error
}
custom api functions required by pinecone / p2p demos
type QuerySearchProfilesRequest ¶
type QuerySearchProfilesRequest struct { // The search string to match SearchString string // How many results to return Limit int }
QuerySearchProfilesRequest is the request for QueryProfile
type QuerySearchProfilesResponse ¶
type QuerySearchProfilesResponse struct { // Profiles matching the search Profiles []authtypes.Profile }
QuerySearchProfilesResponse is the response for QuerySearchProfilesRequest
type QueryThreePIDsForLocalpartRequest ¶
type QueryThreePIDsForLocalpartRequest struct {
Localpart string
}
type RoomserverUserAPI ¶
type RoomserverUserAPI interface { QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, res *QueryAccountDataResponse) error JudgeShouldAutoJoin(ctx context.Context, inviter, invitee string) (bool, error) }
type SyncUserAPI ¶
type SyncUserAPI interface { QueryAcccessTokenAPI QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, res *QueryAccountDataResponse) error PerformLastSeenUpdate(ctx context.Context, req *PerformLastSeenUpdateRequest, res *PerformLastSeenUpdateResponse) error JudgeShouldAutoJoin(ctx context.Context, inviter, invitee string) (bool, error) PerformDeviceUpdate(ctx context.Context, req *PerformDeviceUpdateRequest, res *PerformDeviceUpdateResponse) error QueryDevices(ctx context.Context, req *QueryDevicesRequest, res *QueryDevicesResponse) error QueryDeviceInfos(ctx context.Context, req *QueryDeviceInfosRequest, res *QueryDeviceInfosResponse) error }
api functions required by the sync api
type UserInfo ¶
type UserInfo struct {
Sub string // The Matrix user's ID who generated the token
}
UserInfo is for returning information about the user an OpenID token was issued for
type UserInternalAPI ¶
type UserInternalAPI interface { AppserviceUserAPI SyncUserAPI ClientUserAPI MediaUserAPI FederationUserAPI RoomserverUserAPI KeyserverUserAPI QuerySearchProfilesAPI // used by p2p demos }
UserInternalAPI is the internal API for information about users and devices.
type UserInternalAPITrace ¶
type UserInternalAPITrace struct {
Impl UserInternalAPI
}
UserInternalAPITrace wraps a RoomserverInternalAPI and logs the complete request/response/error
func (*UserInternalAPITrace) AddTelNumbers ¶
func (*UserInternalAPITrace) InputAccountData ¶
func (t *UserInternalAPITrace) InputAccountData(ctx context.Context, req *InputAccountDataRequest, res *InputAccountDataResponse) error
func (*UserInternalAPITrace) InsertAddressBook ¶
func (*UserInternalAPITrace) InsertChainData ¶
func (*UserInternalAPITrace) InsertRelationInvite ¶
func (*UserInternalAPITrace) JudgeShouldAutoJoin ¶
func (*UserInternalAPITrace) PerformAccountCreation ¶
func (t *UserInternalAPITrace) PerformAccountCreation(ctx context.Context, req *PerformAccountCreationRequest, res *PerformAccountCreationResponse) error
func (*UserInternalAPITrace) PerformAccountDeactivation ¶
func (t *UserInternalAPITrace) PerformAccountDeactivation(ctx context.Context, req *PerformAccountDeactivationRequest, res *PerformAccountDeactivationResponse) error
func (*UserInternalAPITrace) PerformDeviceCreation ¶
func (t *UserInternalAPITrace) PerformDeviceCreation(ctx context.Context, req *PerformDeviceCreationRequest, res *PerformDeviceCreationResponse) error
func (*UserInternalAPITrace) PerformDeviceDeletion ¶
func (t *UserInternalAPITrace) PerformDeviceDeletion(ctx context.Context, req *PerformDeviceDeletionRequest, res *PerformDeviceDeletionResponse) error
func (*UserInternalAPITrace) PerformDeviceUpdate ¶
func (t *UserInternalAPITrace) PerformDeviceUpdate(ctx context.Context, req *PerformDeviceUpdateRequest, res *PerformDeviceUpdateResponse) error
func (*UserInternalAPITrace) PerformForgetThreePID ¶
func (t *UserInternalAPITrace) PerformForgetThreePID(ctx context.Context, req *PerformForgetThreePIDRequest, res *struct{}) error
func (*UserInternalAPITrace) PerformKeyBackup ¶
func (t *UserInternalAPITrace) PerformKeyBackup(ctx context.Context, req *PerformKeyBackupRequest, res *PerformKeyBackupResponse) error
func (*UserInternalAPITrace) PerformLastSeenUpdate ¶
func (t *UserInternalAPITrace) PerformLastSeenUpdate(ctx context.Context, req *PerformLastSeenUpdateRequest, res *PerformLastSeenUpdateResponse) error
func (*UserInternalAPITrace) PerformLoginTokenCreation ¶
func (t *UserInternalAPITrace) PerformLoginTokenCreation(ctx context.Context, req *PerformLoginTokenCreationRequest, res *PerformLoginTokenCreationResponse) error
func (*UserInternalAPITrace) PerformLoginTokenDeletion ¶
func (t *UserInternalAPITrace) PerformLoginTokenDeletion(ctx context.Context, req *PerformLoginTokenDeletionRequest, res *PerformLoginTokenDeletionResponse) error
func (*UserInternalAPITrace) PerformOpenIDTokenCreation ¶
func (t *UserInternalAPITrace) PerformOpenIDTokenCreation(ctx context.Context, req *PerformOpenIDTokenCreationRequest, res *PerformOpenIDTokenCreationResponse) error
func (*UserInternalAPITrace) PerformPasswordUpdate ¶
func (t *UserInternalAPITrace) PerformPasswordUpdate(ctx context.Context, req *PerformPasswordUpdateRequest, res *PerformPasswordUpdateResponse) error
func (*UserInternalAPITrace) PerformPushRulesPut ¶
func (t *UserInternalAPITrace) PerformPushRulesPut(ctx context.Context, req *PerformPushRulesPutRequest, res *struct{}) error
func (*UserInternalAPITrace) PerformPusherDeletion ¶
func (t *UserInternalAPITrace) PerformPusherDeletion(ctx context.Context, req *PerformPusherDeletionRequest, res *struct{}) error
func (*UserInternalAPITrace) PerformPusherSet ¶
func (t *UserInternalAPITrace) PerformPusherSet(ctx context.Context, req *PerformPusherSetRequest, res *struct{}) error
func (*UserInternalAPITrace) PerformSaveThreePIDAssociation ¶
func (t *UserInternalAPITrace) PerformSaveThreePIDAssociation(ctx context.Context, req *PerformSaveThreePIDAssociationRequest, res *struct{}) error
func (*UserInternalAPITrace) QueryAccessToken ¶
func (t *UserInternalAPITrace) QueryAccessToken(ctx context.Context, req *QueryAccessTokenRequest, res *QueryAccessTokenResponse) error
func (*UserInternalAPITrace) QueryAccountAvailability ¶
func (t *UserInternalAPITrace) QueryAccountAvailability(ctx context.Context, req *QueryAccountAvailabilityRequest, res *QueryAccountAvailabilityResponse) error
func (*UserInternalAPITrace) QueryAccountByPassword ¶
func (t *UserInternalAPITrace) QueryAccountByPassword(ctx context.Context, req *QueryAccountByPasswordRequest, res *QueryAccountByPasswordResponse) error
func (*UserInternalAPITrace) QueryAccountData ¶
func (t *UserInternalAPITrace) QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, res *QueryAccountDataResponse) error
func (*UserInternalAPITrace) QueryDeviceInfos ¶
func (t *UserInternalAPITrace) QueryDeviceInfos(ctx context.Context, req *QueryDeviceInfosRequest, res *QueryDeviceInfosResponse) error
func (*UserInternalAPITrace) QueryDevices ¶
func (t *UserInternalAPITrace) QueryDevices(ctx context.Context, req *QueryDevicesRequest, res *QueryDevicesResponse) error
func (*UserInternalAPITrace) QueryKeyBackup ¶
func (t *UserInternalAPITrace) QueryKeyBackup(ctx context.Context, req *QueryKeyBackupRequest, res *QueryKeyBackupResponse)
func (*UserInternalAPITrace) QueryLocalpartForThreePID ¶
func (t *UserInternalAPITrace) QueryLocalpartForThreePID(ctx context.Context, req *QueryLocalpartForThreePIDRequest, res *QueryLocalpartForThreePIDResponse) error
func (*UserInternalAPITrace) QueryLoginToken ¶
func (t *UserInternalAPITrace) QueryLoginToken(ctx context.Context, req *QueryLoginTokenRequest, res *QueryLoginTokenResponse) error
func (*UserInternalAPITrace) QueryNotifications ¶
func (t *UserInternalAPITrace) QueryNotifications(ctx context.Context, req *QueryNotificationsRequest, res *QueryNotificationsResponse) error
func (*UserInternalAPITrace) QueryNumericLocalpart ¶
func (t *UserInternalAPITrace) QueryNumericLocalpart(ctx context.Context, res *QueryNumericLocalpartResponse) error
func (*UserInternalAPITrace) QueryOpenIDToken ¶
func (t *UserInternalAPITrace) QueryOpenIDToken(ctx context.Context, req *QueryOpenIDTokenRequest, res *QueryOpenIDTokenResponse) error
func (*UserInternalAPITrace) QueryProfile ¶
func (t *UserInternalAPITrace) QueryProfile(ctx context.Context, req *QueryProfileRequest, res *QueryProfileResponse) error
func (*UserInternalAPITrace) QueryPushRules ¶
func (t *UserInternalAPITrace) QueryPushRules(ctx context.Context, req *QueryPushRulesRequest, res *QueryPushRulesResponse) error
func (*UserInternalAPITrace) QueryPushers ¶
func (t *UserInternalAPITrace) QueryPushers(ctx context.Context, req *QueryPushersRequest, res *QueryPushersResponse) error
func (*UserInternalAPITrace) QuerySearchProfiles ¶
func (t *UserInternalAPITrace) QuerySearchProfiles(ctx context.Context, req *QuerySearchProfilesRequest, res *QuerySearchProfilesResponse) error
func (*UserInternalAPITrace) QueryThreePIDsForLocalpart ¶
func (t *UserInternalAPITrace) QueryThreePIDsForLocalpart(ctx context.Context, req *QueryThreePIDsForLocalpartRequest, res *QueryThreePIDsForLocalpartResponse) error
func (*UserInternalAPITrace) SelectChainData ¶
func (t *UserInternalAPITrace) SelectChainData(ctx context.Context, localpart string) (*types2.UserChainInfo, error)
func (*UserInternalAPITrace) SetAvatarURL ¶
func (t *UserInternalAPITrace) SetAvatarURL(ctx context.Context, req *PerformSetAvatarURLRequest, res *PerformSetAvatarURLResponse) error
func (*UserInternalAPITrace) SetChatFee ¶
func (*UserInternalAPITrace) SetDisplayName ¶
func (t *UserInternalAPITrace) SetDisplayName(ctx context.Context, req *PerformUpdateDisplayNameRequest, res *struct{}) error
func (*UserInternalAPITrace) SetMortgageFee ¶
type UserLoginAPI ¶
type UserLoginAPI interface {
QueryAccountByPassword(ctx context.Context, req *QueryAccountByPasswordRequest, res *QueryAccountByPasswordResponse) error
}