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

Method validatePassword

backend/api/v1/user_service.go:282–295  ·  view source on GitHub ↗
(ctx context.Context, workspaceID, password string)

Source from the content-addressed store, hash-verified

280}
281
282func (s *UserService) validatePassword(ctx context.Context, workspaceID, password string) error {
283 restriction, err := getAccountRestriction(
284 ctx,
285 s.store,
286 s.licenseService,
287 s.profile.SaaS,
288 workspaceID,
289 )
290 if err != nil {
291 return err
292 }
293 passwordRestriction := convertToStorePasswordRestriction(restriction.PasswordRestriction)
294 return validatePasswordWithRestriction(password, passwordRestriction)
295}
296
297func validatePasswordWithRestriction(password string, passwordRestriction *storepb.WorkspaceProfileSetting_PasswordRestriction) error {
298 if len(password) < int(passwordRestriction.GetMinLength()) {

Callers 2

CreateUserMethod · 0.95
UpdateUserMethod · 0.95

Tested by

no test coverage detected