// SetHasCredential sets the HasCredential field's value.
504240
func (s *APNSSandboxChannelResponse) SetHasCredential(v bool) *APNSSandboxChannelResponse {
	s.HasCredential = &v
	return s
}
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
}
1154827
func (cgs *credentialGraphSet) HeadCredential(pe *pathexp.PathExp, name string) (envelope.CredentialInf, error) {
	var head envelope.CredentialInf
	version := -1

	gpe, err := pe.WithInstance("*")
	if err != nil {
		return nil, err
	}

	graphs, ok := cgs.graphs[gpe.String()]
	if !ok {
		return nil, nil
	}

	sort.Sort(graphSorter(graphs))
	for _, graph := range graphs {
		creds := graph.GetCredentials()
		for _, cred := range creds {
			if cred.PathExp().Equal(pe) && cred.Name() == name && cred.CredentialVersion() > version {
				env := cred
				head = env
				version = cred.CredentialVersion()
			}
		}
	}

	return head, nil
}
173931
func (c *Config) WithCredentialsChainVerboseErrors(verboseErrs bool) *Config {
	c.CredentialsChainVerboseErrors = &verboseErrs
	return c
}
30133
func (s *CreateHsmClientCertificateInput) SetHsmClientCertificateIdentifier(v string) *CreateHsmClientCertificateInput {
	s.HsmClientCertificateIdentifier = &v
	return s
}
778267
func (s *BaiduChannelResponse) SetCredential(v string) *BaiduChannelResponse {
	s.Credential = &v
	return s
}
962542
func (m *Model) ValidateCloudCredential(tag names.CloudCredentialTag, credential cloud.Credential) error {
	cloud, err := m.st.Cloud(m.Cloud())
	if err != nil {
		return errors.Annotatef(err, "getting cloud %q", m.Cloud())
	}

	err = validateCredentialForCloud(cloud, tag, convertCloudCredentialToState(tag, credential))
	if err != nil {
		return errors.Annotatef(err, "validating credential %q for cloud %q", tag.Id(), cloud.Name)
	}
	return nil
}
1274214
func (s *RotateIngestEndpointCredentialsOutput) SetHlsIngest(v *HlsIngest) *RotateIngestEndpointCredentialsOutput {
	s.HlsIngest = v
	return s
}
29095
func AsDefaultCredentials(ctx *AssertContext) {
	conf := ctx.Config
	Expect(conf).ToNot(BeNil(),
		"cannot set static AssertContext without config")

	tempFile, err := ioutil.TempFile("", "bosh-gcscli-service-account-file")
	Expect(err).ToNot(HaveOccurred())
	defer tempFile.Close()

	tempFile.WriteString(ctx.serviceAccountFile)

	ctx.serviceAccountPath = tempFile.Name()
	os.Setenv(GoogleAppCredentialsEnv, ctx.serviceAccountPath)

	conf.CredentialsSource = config.DefaultCredentialsSource
}
224810
func (jolokiaClient *JolokiaClient) SetCredential(userName string, pass string) {
	jolokiaClient.user = userName
	jolokiaClient.pass = pass
}
396655
func (s *DeclineHandshakeOutput) SetHandshake(v *Handshake) *DeclineHandshakeOutput {
	s.Handshake = v
	return s
}
644794
func (mg *MailgunImpl) DeleteCredential(ctx context.Context, id string) error {
	if id == "" {
		return ErrEmptyParam
	}
	r := newHTTPRequest(generateCredentialsUrl(mg, id))
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	_, err := makeDeleteRequest(ctx, r)
	return err
}
783700
func (c *MemStore) CredentialForCloud(cloudName string) (*cloud.CloudCredential, error) {
	c.mu.Lock()
	defer c.mu.Unlock()

	if result, ok := c.Credentials[cloudName]; ok {
		return &result, nil
	}
	return nil, errors.NotFoundf("credentials for cloud %s", cloudName)
}
528575
func (s *UpdateAccountPasswordPolicyInput) SetHardExpiry(v bool) *UpdateAccountPasswordPolicyInput {
	s.HardExpiry = &v
	return s
}
1280044
func (c *Config) WithCredentials(creds *credentials.Credentials) *Config {
	c.Credentials = creds
	return c
}
620676
func (s *CancelHandshakeOutput) SetHandshake(v *Handshake) *CancelHandshakeOutput {
	s.Handshake = v
	return s
}
716151
func (s *APNSChannelResponse) SetHasCredential(v bool) *APNSChannelResponse {
	s.HasCredential = &v
	return s
}