mirror of
https://github.com/zitadel/zitadel.git
synced 2025-04-18 14:52:02 +00:00

* at least registration prompt works * in memory test for login * buttons to start webauthn process * begin eventstore impl * begin eventstore impl * serialize into bytes * fix: u2f, passwordless types * fix for localhost * fix script * fix: u2f, passwordless types * fix: add u2f * fix: verify u2f * fix: session data in event store * fix: u2f credentials in eventstore * fix: webauthn pkg handles business models * feat: tests * feat: append events * fix: test * fix: check only ready webauthn creds * fix: move u2f methods to authrepo * frontend improvements * fix return * feat: add passwordless * feat: add passwordless * improve ui / error handling * separate call for login * fix login * js * feat: u2f login methods * feat: remove unused session id * feat: error handling * feat: error handling * feat: refactor user eventstore * feat: finish webauthn * feat: u2f and passwordlss in auth.proto * u2f step * passwordless step * cleanup js * EndpointPasswordLessLogin * migration * update mfaChecked test * next step test * token name * cleanup * attribute * passwordless as tokens * remove sms as otp type * add "user" to amr for webauthn * error handling * fixes * fix tests * naming * naming * fixes * session handler * i18n * error handling in login * Update internal/ui/login/static/i18n/de.yaml Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com> * Update internal/ui/login/static/i18n/en.yaml Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com> * improvements * merge fixes * fixes * fixes Co-authored-by: Fabiennne <fabienne.gerschwiler@gmail.com> Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
91 lines
4.0 KiB
Go
91 lines
4.0 KiB
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
org_model "github.com/caos/zitadel/internal/org/model"
|
|
|
|
"github.com/caos/zitadel/internal/user/model"
|
|
)
|
|
|
|
type UserRepository interface {
|
|
Register(ctx context.Context, user *model.User, member *org_model.OrgMember, resourceOwner string) (*model.User, error)
|
|
RegisterExternalUser(ctx context.Context, user *model.User, externalIDP *model.ExternalIDP, member *org_model.OrgMember, resourceOwner string) (*model.User, error)
|
|
|
|
myUserRepo
|
|
SkipMFAInit(ctx context.Context, userID string) error
|
|
|
|
RequestPasswordReset(ctx context.Context, username string) error
|
|
SetPassword(ctx context.Context, userID, code, password string) error
|
|
ChangePassword(ctx context.Context, userID, old, new string) error
|
|
|
|
VerifyEmail(ctx context.Context, userID, code string) error
|
|
ResendEmailVerificationMail(ctx context.Context, userID string) error
|
|
|
|
VerifyInitCode(ctx context.Context, userID, code, password string) error
|
|
ResendInitVerificationMail(ctx context.Context, userID string) error
|
|
|
|
AddMFAOTP(ctx context.Context, userID string) (*model.OTP, error)
|
|
VerifyMFAOTPSetup(ctx context.Context, userID, code string) error
|
|
|
|
AddMFAU2F(ctx context.Context, id string) (*model.WebAuthNToken, error)
|
|
VerifyMFAU2FSetup(ctx context.Context, userID, tokenName string, credentialData []byte) error
|
|
RemoveMFAU2F(ctx context.Context, userID, webAuthNTokenID string) error
|
|
|
|
AddPasswordless(ctx context.Context, id string) (*model.WebAuthNToken, error)
|
|
VerifyPasswordlessSetup(ctx context.Context, userID, tokenName string, credentialData []byte) error
|
|
RemovePasswordless(ctx context.Context, userID, webAuthNTokenID string) error
|
|
|
|
ChangeUsername(ctx context.Context, userID, username string) error
|
|
|
|
SignOut(ctx context.Context, agentID string) error
|
|
|
|
UserByID(ctx context.Context, userID string) (*model.UserView, error)
|
|
|
|
MachineKeyByID(ctx context.Context, keyID string) (*model.MachineKeyView, error)
|
|
}
|
|
|
|
type myUserRepo interface {
|
|
MyUser(ctx context.Context) (*model.UserView, error)
|
|
|
|
MyProfile(ctx context.Context) (*model.Profile, error)
|
|
ChangeMyProfile(ctx context.Context, profile *model.Profile) (*model.Profile, error)
|
|
|
|
MyEmail(ctx context.Context) (*model.Email, error)
|
|
ChangeMyEmail(ctx context.Context, email *model.Email) (*model.Email, error)
|
|
VerifyMyEmail(ctx context.Context, code string) error
|
|
ResendMyEmailVerificationMail(ctx context.Context) error
|
|
|
|
MyPhone(ctx context.Context) (*model.Phone, error)
|
|
ChangeMyPhone(ctx context.Context, phone *model.Phone) (*model.Phone, error)
|
|
RemoveMyPhone(ctx context.Context) error
|
|
VerifyMyPhone(ctx context.Context, code string) error
|
|
ResendMyPhoneVerificationCode(ctx context.Context) error
|
|
|
|
MyAddress(ctx context.Context) (*model.Address, error)
|
|
ChangeMyAddress(ctx context.Context, address *model.Address) (*model.Address, error)
|
|
|
|
ChangeMyPassword(ctx context.Context, old, new string) error
|
|
|
|
SearchMyExternalIDPs(ctx context.Context, request *model.ExternalIDPSearchRequest) (*model.ExternalIDPSearchResponse, error)
|
|
AddMyExternalIDP(ctx context.Context, externalIDP *model.ExternalIDP) (*model.ExternalIDP, error)
|
|
RemoveMyExternalIDP(ctx context.Context, externalIDP *model.ExternalIDP) error
|
|
|
|
MyUserMFAs(ctx context.Context) ([]*model.MultiFactor, error)
|
|
AddMyMFAOTP(ctx context.Context) (*model.OTP, error)
|
|
VerifyMyMFAOTPSetup(ctx context.Context, code string) error
|
|
RemoveMyMFAOTP(ctx context.Context) error
|
|
|
|
AddMyMFAU2F(ctx context.Context) (*model.WebAuthNToken, error)
|
|
VerifyMyMFAU2FSetup(ctx context.Context, tokenName string, data []byte) error
|
|
RemoveMyMFAU2F(ctx context.Context, webAuthNTokenID string) error
|
|
|
|
AddMyPasswordless(ctx context.Context) (*model.WebAuthNToken, error)
|
|
VerifyMyPasswordlessSetup(ctx context.Context, tokenName string, data []byte) error
|
|
RemoveMyPasswordless(ctx context.Context, webAuthNTokenID string) error
|
|
|
|
ChangeMyUsername(ctx context.Context, username string) error
|
|
|
|
MyUserChanges(ctx context.Context, lastSequence uint64, limit uint64, sortAscending bool) (*model.UserChanges, error)
|
|
}
|