2020-05-18 10:06:36 +00:00
|
|
|
package repository
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-09-27 11:43:49 +00:00
|
|
|
|
2021-02-23 14:13:04 +00:00
|
|
|
"github.com/caos/zitadel/internal/domain"
|
2020-05-18 10:06:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type AuthRequestRepository interface {
|
2021-02-08 10:30:30 +00:00
|
|
|
CreateAuthRequest(ctx context.Context, request *domain.AuthRequest) (*domain.AuthRequest, error)
|
|
|
|
AuthRequestByID(ctx context.Context, id, userAgentID string) (*domain.AuthRequest, error)
|
|
|
|
AuthRequestByIDCheckLoggedIn(ctx context.Context, id, userAgentID string) (*domain.AuthRequest, error)
|
|
|
|
AuthRequestByCode(ctx context.Context, code string) (*domain.AuthRequest, error)
|
2020-08-31 06:49:35 +00:00
|
|
|
SaveAuthCode(ctx context.Context, id, code, userAgentID string) error
|
2020-06-05 05:50:04 +00:00
|
|
|
DeleteAuthRequest(ctx context.Context, id string) error
|
2020-12-02 16:00:04 +00:00
|
|
|
|
2020-08-31 06:49:35 +00:00
|
|
|
CheckLoginName(ctx context.Context, id, loginName, userAgentID string) error
|
2021-02-08 10:30:30 +00:00
|
|
|
CheckExternalUserLogin(ctx context.Context, authReqID, userAgentID string, user *domain.ExternalUser, info *domain.BrowserInfo) error
|
2021-08-11 11:50:03 +00:00
|
|
|
SetExternalUserLogin(ctx context.Context, authReqID, userAgentID string, user *domain.ExternalUser) error
|
2020-08-31 06:49:35 +00:00
|
|
|
SelectUser(ctx context.Context, id, userID, userAgentID string) error
|
2020-09-18 11:26:28 +00:00
|
|
|
SelectExternalIDP(ctx context.Context, authReqID, idpConfigID, userAgentID string) error
|
2021-02-08 10:30:30 +00:00
|
|
|
VerifyPassword(ctx context.Context, id, userID, resourceOwner, password, userAgentID string, info *domain.BrowserInfo) error
|
2020-12-02 16:00:04 +00:00
|
|
|
|
2021-02-08 10:30:30 +00:00
|
|
|
VerifyMFAOTP(ctx context.Context, authRequestID, userID, resourceOwner, code, userAgentID string, info *domain.BrowserInfo) error
|
|
|
|
BeginMFAU2FLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string) (*domain.WebAuthNLogin, error)
|
|
|
|
VerifyMFAU2F(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string, credentialData []byte, info *domain.BrowserInfo) error
|
2021-10-04 14:19:21 +00:00
|
|
|
BeginPasswordlessSetup(ctx context.Context, userID, resourceOwner string, preferredPlatformType domain.AuthenticatorAttachment) (login *domain.WebAuthNToken, err error)
|
2021-08-02 13:24:58 +00:00
|
|
|
VerifyPasswordlessSetup(ctx context.Context, userID, resourceOwner, userAgentID, tokenName string, credentialData []byte) (err error)
|
2021-10-04 14:19:21 +00:00
|
|
|
BeginPasswordlessInitCodeSetup(ctx context.Context, userID, resourceOwner, codeID, verificationCode string, preferredPlatformType domain.AuthenticatorAttachment) (login *domain.WebAuthNToken, err error)
|
2021-08-02 13:24:58 +00:00
|
|
|
VerifyPasswordlessInitCodeSetup(ctx context.Context, userID, resourceOwner, userAgentID, tokenName, codeID, verificationCode string, credentialData []byte) (err error)
|
2021-02-08 10:30:30 +00:00
|
|
|
BeginPasswordlessLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string) (*domain.WebAuthNLogin, error)
|
|
|
|
VerifyPasswordless(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string, credentialData []byte, info *domain.BrowserInfo) error
|
2020-12-02 16:00:04 +00:00
|
|
|
|
2021-02-08 10:30:30 +00:00
|
|
|
LinkExternalUsers(ctx context.Context, authReqID, userAgentID string, info *domain.BrowserInfo) error
|
2021-11-02 09:08:47 +00:00
|
|
|
AutoRegisterExternalUser(ctx context.Context, user *domain.Human, externalIDP *domain.UserIDPLink, orgMemberRoles []string, authReqID, userAgentID, resourceOwner string, metadatas []*domain.Metadata, info *domain.BrowserInfo) error
|
2020-09-28 07:29:41 +00:00
|
|
|
ResetLinkingUsers(ctx context.Context, authReqID, userAgentID string) error
|
2020-05-18 10:06:36 +00:00
|
|
|
}
|