// NewBasicAccount returns a new BasicAccount instance
436771
func NewBasicAccount(AccountId string, Name *Name, Email string, EmailVerified bool, Disabled bool, IsTeammate bool) *BasicAccount {
	s := new(BasicAccount)
	s.AccountId = AccountId
	s.Name = Name
	s.Email = Email
	s.EmailVerified = EmailVerified
	s.Disabled = Disabled
	s.IsTeammate = IsTeammate
	return s
}
425546
func (ctx *Context) GetBasicAuth() (string, string, error) {
	if len(ctx.Request.Header["Authorization"]) == 0 {
		return "", "", errors.New("No Authorization header provided")
	}
	authHeader := ctx.Request.Header["Authorization"][0]
	authString := strings.Split(string(authHeader), " ")
	if authString[0] != "Basic" {
		return "", "", errors.New("Not Basic Authentication")
	}
	decodedAuth, err := base64.StdEncoding.DecodeString(authString[1])
	if err != nil {
		return "", "", err
	}
	authSlice := strings.Split(string(decodedAuth), ":")
	if len(authSlice) != 2 {
		return "", "", errors.New("Error delimiting authString into username/password. Malformed input: " + authString[1])
	}
	return authSlice[0], authSlice[1], nil
}
62679
func (r *RequestConfig) BasicAuth(username, password string) *RequestConfig {
	r.User = username
	r.Password = password
	return r
}
1323855
func (s *ScopedKeyManager) AddrAccount(ns walletdb.ReadBucket,
	address btcutil.Address) (uint32, error) {

	account, err := fetchAddrAccount(ns, &s.scope, address.ScriptAddress())
	if err != nil {
		return 0, maybeConvertDbError(err)
	}

	return account, nil
}
709363
func (c *Context) RequireBasicAuth(username, password string) {
	fields := strings.Fields(c.Req.Header.Get("Authorization"))
	if len(fields) != 2 || fields[0] != "Basic" {
		c.Status(http.StatusUnauthorized)
		return
	}

	uname, passwd, _ := tool.BasicAuthDecode(fields[1])
	if uname != username || passwd != password {
		c.Status(http.StatusForbidden)
		return
	}
}
364697
func newAuthenticatorFromBasicAuthFile(basicAuthFile string) (authenticator.Request, error) {
	basicAuthenticator, err := passwordfile.NewCSV(basicAuthFile)
	if err != nil {
		return nil, err
	}

	return basicauth.New(basicAuthenticator), nil
}
57630
func parseBasicAuth(auth string) (username, password []byte, ok bool) {
	const prefix = "Basic "
	if !strings.HasPrefix(auth, prefix) {
		return
	}
	c, err := base64.StdEncoding.DecodeString(auth[len(prefix):])
	if err != nil {
		return
	}

	s := bytes.IndexByte(c, ':')
	if s < 0 {
		return
	}
	return c[:s], c[s+1:], true
}
673173
func NewGetAccount(ctx *middleware.Context, handler GetAccountHandler) *GetAccount {
	return &GetAccount{Context: ctx, Handler: handler}
}
275246
func newBasicAuthRoundTripper(username, password string, rt http.RoundTripper) http.RoundTripper {
	return &basicAuthRoundTripper{username, password, rt}
}
365299
func (s *CreateBranchInput) SetBasicAuthCredentials(v string) *CreateBranchInput {
	s.BasicAuthCredentials = &v
	return s
}
1081829
func NewAccount(service *goa.Service, db *store.DB) *AccountController {
	return &AccountController{
		Controller: service.NewController("Account"),
		db:         db,
	}
}
40182
func AuthBasic(username string, password string) ProxyAuthorization {
	return &basicAuth{username: username, password: password}
}
848289
func (p *Pusher) BasicAuth(username, password string) *Pusher {
	p.useBasicAuth = true
	p.username = username
	p.password = password
	return p
}
173383
func BasicAuth(fn BasicAuthValidator) echo.MiddlewareFunc {
	c := DefaultBasicAuthConfig
	c.Validator = fn
	return BasicAuthWithConfig(c)
}
715934
func NewBasic() *Basic {
	return &Basic{
		lock:      new(sync.Mutex),
		whitelist: map[string]bool{},
	}
}
373189
func (s *UpdateBranchInput) SetBasicAuthCredentials(v string) *UpdateBranchInput {
	s.BasicAuthCredentials = &v
	return s
}
386262
func AddAccount(bundle *stellar1.Bundle, secretKey stellar1.SecretKey, name string, makePrimary bool) (err error) {
	if bundle == nil {
		return fmt.Errorf("nil bundle")
	}
	secretKey, accountID, _, err := libkb.ParseStellarSecretKey(string(secretKey))
	if err != nil {
		return err
	}
	if name == "" {
		return fmt.Errorf("Name required for new account")
	}
	if makePrimary {
		for i := range bundle.Accounts {
			bundle.Accounts[i].IsPrimary = false
		}
	}
	bundle.Accounts = append(bundle.Accounts, stellar1.BundleEntry{
		AccountID:          accountID,
		Mode:               stellar1.AccountMode_USER,
		IsPrimary:          makePrimary,
		AcctBundleRevision: 1,
		Name:               name,
	})
	bundle.AccountBundles[accountID] = stellar1.AccountBundle{
		AccountID: accountID,
		Signers:   []stellar1.SecretKey{secretKey},
	}
	return bundle.CheckInvariants()
}