MCPcopy Create free account
hub / github.com/bytebase/bytebase / validateEndUserEmail

Function validateEndUserEmail

backend/api/v1/user_service.go:751–759  ·  view source on GitHub ↗
(email string)

Source from the content-addressed store, hash-verified

749}
750
751func validateEndUserEmail(email string) error {
752 if common.IsServiceAccountEmail(email) {
753 return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("email for end users cannot end with %v", common.ServiceAccountSuffix))
754 }
755 if common.IsWorkloadIdentityEmail(email) {
756 return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("email for end users cannot end with %v", common.WorkloadIdentitySuffix))
757 }
758 return nil
759}
760
761func validateEmailWithDomains(ctx context.Context, licenseService *enterprise.LicenseService, stores *store.Store, workspaceID, email string, checkDomainSetting bool) error {
762 if err := validateEndUserEmail(email); err != nil {

Callers 8

GetUserMethod · 0.85
BatchGetUsersMethod · 0.85
UpdateUserMethod · 0.85
DeleteUserMethod · 0.85
UndeleteUserMethod · 0.85
validateEmailWithDomainsFunction · 0.85
SignupMethod · 0.85

Calls 3

IsServiceAccountEmailFunction · 0.92
IsWorkloadIdentityEmailFunction · 0.92
ErrorfMethod · 0.80

Tested by

no test coverage detected