mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 08:13:09 -06:00
Merge Threepid API with User API
This commit is contained in:
parent
35622c8b94
commit
d36116c089
|
|
@ -1,38 +0,0 @@
|
|||
package threepid
|
||||
|
||||
import "context"
|
||||
|
||||
type API interface {
|
||||
CreateSession(context.Context, *CreateSessionRequest, *Session) error
|
||||
ValidateSession(context.Context, *ValidateSessionRequest, struct{}) error
|
||||
GetThreePidForSession(context.Context, *SessionOwnership, *GetThreePidForSessionResponse) error
|
||||
DeleteSession(context.Context, *SessionOwnership, struct{}) error
|
||||
IsSessionValidated(context.Context, *SessionOwnership, *IsSessionValidatedResponse) error
|
||||
}
|
||||
|
||||
type CreateSessionRequest struct {
|
||||
ClientSecret, NextLink, ThreePid string
|
||||
}
|
||||
|
||||
type ValidateSessionRequest struct {
|
||||
SessionOwnership
|
||||
Token string
|
||||
}
|
||||
|
||||
type GetThreePidForSessionResponse struct {
|
||||
ThreePid string
|
||||
}
|
||||
|
||||
type SessionOwnership struct {
|
||||
Sid, ClientSecret string
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
Sid, ClientSecret, ThreePid, Token, NextLink string
|
||||
SendAttempt int
|
||||
}
|
||||
|
||||
type IsSessionValidatedResponse struct {
|
||||
Validated bool
|
||||
ValidatedAt int
|
||||
}
|
||||
|
|
@ -40,6 +40,11 @@ type UserInternalAPI interface {
|
|||
QueryDeviceInfos(ctx context.Context, req *QueryDeviceInfosRequest, res *QueryDeviceInfosResponse) error
|
||||
QuerySearchProfiles(ctx context.Context, req *QuerySearchProfilesRequest, res *QuerySearchProfilesResponse) error
|
||||
QueryOpenIDToken(ctx context.Context, req *QueryOpenIDTokenRequest, res *QueryOpenIDTokenResponse) error
|
||||
CreateSession(context.Context, *CreateSessionRequest, *Session) error
|
||||
ValidateSession(context.Context, *ValidateSessionRequest, struct{}) error
|
||||
GetThreePidForSession(context.Context, *SessionOwnership, *GetThreePidForSessionResponse) error
|
||||
DeleteSession(context.Context, *SessionOwnership, struct{}) error
|
||||
IsSessionValidated(context.Context, *SessionOwnership, *IsSessionValidatedResponse) error
|
||||
}
|
||||
|
||||
// InputAccountDataRequest is the request for InputAccountData
|
||||
|
|
@ -332,3 +337,31 @@ const (
|
|||
// AccountTypeGuest indicates this is a guest account
|
||||
AccountTypeGuest AccountType = 2
|
||||
)
|
||||
|
||||
type CreateSessionRequest struct {
|
||||
ClientSecret, NextLink, ThreePid string
|
||||
}
|
||||
|
||||
type ValidateSessionRequest struct {
|
||||
SessionOwnership
|
||||
Token string
|
||||
}
|
||||
|
||||
type GetThreePidForSessionResponse struct {
|
||||
ThreePid string
|
||||
}
|
||||
|
||||
type SessionOwnership struct {
|
||||
Sid, ClientSecret string
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
Sid, ClientSecret, ThreePid, Token, NextLink string
|
||||
SendAttempt, ValidatedAt int
|
||||
Validated bool
|
||||
}
|
||||
|
||||
type IsSessionValidatedResponse struct {
|
||||
Validated bool
|
||||
ValidatedAt int
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue