github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/api/apifakes/old_fake_password_repo.go (about)

     1  package apifakes
     2  
     3  import "code.cloudfoundry.org/cli/cf/errors"
     4  
     5  type OldFakePasswordRepo struct {
     6  	Score          string
     7  	ScoredPassword string
     8  
     9  	UpdateUnauthorized bool
    10  	UpdateNewPassword  string
    11  	UpdateOldPassword  string
    12  }
    13  
    14  func (repo *OldFakePasswordRepo) UpdatePassword(old string, new string) (apiErr error) {
    15  	repo.UpdateOldPassword = old
    16  	repo.UpdateNewPassword = new
    17  
    18  	if repo.UpdateUnauthorized {
    19  		apiErr = errors.NewHTTPError(401, "unauthorized", "Authorization Failed")
    20  	}
    21  
    22  	return
    23  }