// Password sets the password to authenticate with the remote cluster.
187563
func (ri *ReindexRemoteInfo) Password(password string) *ReindexRemoteInfo {
	ri.password = password
	return ri
}
1353237
func Password(message string) string {
	return (&Prompter{
		Message: message,
		NoEcho:  true,
	}).Prompt()
}
1327518
func (a *Authenticator) AuthenticatePassword(ctx context.Context, username, password string) (*authenticator.Response, bool, error) {
	identity, ok, err := a.getIdentity(username, password)
	if err != nil {
		return nil, false, err
	}
	if !ok {
		return nil, false, nil
	}

	return identitymapper.ResponseFor(a.mapper, identity)
}
168641
func (s *JoinDomainInput) SetPassword(v string) *JoinDomainInput {
	s.Password = &v
	return s
}
1001186
func (s *ResetPasswordInput) SetPassword(v string) *ResetPasswordInput {
	s.Password = &v
	return s
}
1241558
func (state *UserState) SetPassword(username, password string) {
	state.users.Set(username, "password", state.HashPassword(username, password))
}
1338028
func (a denyPasswordAuthenticator) AuthenticatePassword(ctx context.Context, username, password string) (*authenticator.Response, bool, error) {
	return nil, false, nil
}
1023213
func (s *Credential) SetPassword(v string) *Credential {
	s.Password = &v
	return s
}
334410
func (s *InstanceAccessDetails) SetPassword(v string) *InstanceAccessDetails {
	s.Password = &v
	return s
}
468754
func (f PasswordFunc) AuthenticatePassword(ctx context.Context, user, password string) (*Response, bool, error) {
	return f(ctx, user, password)
}
418453
func (a *Application) PasswordValid(password string) bool {
	agentHash := utils.AgentPasswordHash(password)
	if agentHash == a.doc.PasswordHash {
		return true
	}
	return false
}
219186
func (u *Unit) SetPassword(password string) error {
	if len(password) < utils.MinAgentPasswordLength {
		return fmt.Errorf("password is only %d bytes long, and is not a valid Agent password", len(password))
	}
	return u.setPasswordHash(utils.AgentPasswordHash(password))
}
110625
func (s *Secret) Password() string {
	v := s.d[passwordKey]
	if sv, ok := v.(string); ok {
		return sv
	}
	return ""
}
442083
func PasswordSalt(password string) string {
	pass := []byte(password)
	salt, _ := bcrypt.GenerateFromPassword(pass, bcrypt.DefaultCost)
	return string(salt)
}
1288475
func (ch *CredHub) SetPassword(name string, value values.Password) (credentials.Password, error) {
	var cred credentials.Password
	err := ch.setCredential(name, "password", value, &cred)

	return cred, err
}
542198
func (ctx *Context) hash(password []byte, salt []byte) ([]byte, error) {

	if len(password) == 0 {
		return nil, ErrPassword
	}
	if len(salt) == 0 {
		return nil, ErrSalt
	}

	hash := make([]byte, ctx.HashLen)

	// optional secret
	secret := (*C.uint8_t)(nil)
	if len(ctx.Secret) > 0 {
		secret = (*C.uint8_t)(&ctx.Secret[0])
	}

	// optional associated data
	associatedData := (*C.uint8_t)(nil)
	if len(ctx.AssociatedData) > 0 {
		associatedData = (*C.uint8_t)(&ctx.AssociatedData[0])
	}

	// optional flags
	flags := FlagDefault
	if ctx.Flags != 0 {
		flags = ctx.Flags
	}

	// ensure version has a default
	version := VersionDefault
	if ctx.Version != 0 {
		version = ctx.Version
	}

	// wrapper to overcome go pointer passing limitations
	result := C.argon2_wrapper(
		(*C.uint8_t)(&hash[0]), C.uint32_t(ctx.HashLen),
		(*C.uint8_t)(&password[0]), C.uint32_t(len(password)),
		(*C.uint8_t)(&salt[0]), C.uint32_t(len(salt)),
		secret, C.uint32_t(len(ctx.Secret)),
		associatedData, C.uint32_t(len(ctx.AssociatedData)),
		C.uint32_t(ctx.Iterations),
		C.uint32_t(ctx.Memory),
		C.uint32_t(ctx.Parallelism),
		C.uint32_t(ctx.Parallelism),
		C.uint32_t(version),
		nil, nil,
		C.uint32_t(flags),
		C.argon2_type(ctx.Mode))

	if result != C.ARGON2_OK {
		return nil, Error(result)
	}

	return hash, nil
}
408296
func (s *Secret) Password() string {
	s.Lock()
	defer s.Unlock()

	return s.password
}