// NewPasswordCredentials builds a new DBCredentials from a Password string
487752
func NewPasswordCredentials(password string) *DBCredentials {
	hashedpw := sha256.Sum256([]byte(password))
	return &DBCredentials{Passphrase: hashedpw[:]}
}
220045
func (ks *KeyStore) NewAccount(passphrase string) (*Account, error) {
	account, err := ks.keystore.NewAccount(passphrase)
	if err != nil {
		return nil, err
	}
	return &Account{account}, nil
}
1097894
func NewAuth(
	authProviderType AuthTokenProviders,
	s osecrets.Secrets,
) (Auth, error) {
	if s == nil {
		return nil, ErrSecretsNotInitialized
	}
	switch authProviderType {
	case TypeK8s:
		return &k8sAuth{s}, nil
	case TypeDCOS:
		return &dcosAuth{s}, nil
	}
	return nil, fmt.Errorf("secrets type %v not supported", authProviderType)
}
1371941
func (s *VirtualMachineService) NewResetPasswordForVirtualMachineParams(id string) *ResetPasswordForVirtualMachineParams {
	p := &ResetPasswordForVirtualMachineParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
72095
func (a *authenticator) validateCredentials(credentials *credentials) (string, int, error) {
	user, err := a.userDb.GetUser(credentials.Username)
	if err != nil {
		return "", http.StatusUnauthorized, errors.Errorf("401 unauthorized: user name or password is incorrect")
	}
	if err := bcrypt.CompareHashAndPassword([]byte(user.PasswordHash), []byte(credentials.Password)); err != nil {
		return credentials.Username, http.StatusUnauthorized, fmt.Errorf("401 unauthorized: user name or password is incorrect")
	}
	return credentials.Username, 0, nil
}
1193050
func (cli *Client) SetCredentials(userID, accessToken string) {
	cli.AccessToken = accessToken
	cli.UserID = userID
}
837037
func (s *GetSessionTokenOutput) SetCredentials(v *Credentials) *GetSessionTokenOutput {
	s.Credentials = v
	return s
}
1256372
func NewWithCredentials(endpoint string, creds *credentials.Credentials, secure bool, region string) (*Client, error) {
	return privateNew(endpoint, creds, secure, region, BucketLookupAuto)
}
248432
func (s *PutIntegrationInput) SetCredentials(v string) *PutIntegrationInput {
	s.Credentials = &v
	return s
}
1075361
func NewUserStateWithPassword(hostname, password string) *UserState {
	// db index 0, initialize random generator after generating the cookie secret, password
	var connectTo string
	switch {
	case (password == "") && (strings.Count(hostname, ":") == 0):
		connectTo = hostname + ":6379"
	case strings.Count(hostname, ":") > 0:
		connectTo = password + "@" + hostname
	default:
		connectTo = password + "@" + hostname + ":6379"
	}
	// Create a new UserState with database index 0, "true" for seeding the
	// random number generator and host string
	return NewUserState(0, true, connectTo)
}
647942
func (s *Integration) SetCredentials(v string) *Integration {
	s.Credentials = &v
	return s
}
904865
func (cfg *ApplicationConfigEnv) ApplicationCredentials() ApplicationCredentials {
	return ApplicationCredentials{
		ServerURL:    cfg.ServerURL,
		ClientID:     cfg.ClientID,
		ClientSecret: cfg.ClientSecret}
}
757576
func NewPasswordChangeType(Description string) *PasswordChangeType {
	s := new(PasswordChangeType)
	s.Description = Description
	return s
}
983721
func NewCredentialHelpers(helpers []CredentialHelper) CredentialHelper {
	return &CredentialHelpers{
		helpers:        helpers,
		skippedHelpers: make(map[int]bool),
	}
}
514720
func (self *ConnectionString) SetCredentials(username string, password string) {
	self.URI.User = url.UserPassword(username, password)
}
428490
func (s *AssumeRoleOutput) SetCredentials(v *Credentials) *AssumeRoleOutput {
	s.Credentials = v
	return s
}
993220
func (s *GetFederationTokenOutput) SetCredentials(v *Credentials) *GetFederationTokenOutput {
	s.Credentials = v
	return s
}