(ctx context.Context, workspaceID, password string)
| 280 | } |
| 281 | |
| 282 | func (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 | |
| 297 | func validatePasswordWithRestriction(password string, passwordRestriction *storepb.WorkspaceProfileSetting_PasswordRestriction) error { |
| 298 | if len(password) < int(passwordRestriction.GetMinLength()) { |
no test coverage detected