github.com/jasonkeene/cli@v6.14.1-0.20160816203908-ca5715166dfb+incompatible/cf/api/apifakes/old_fake_password_repo.go (about)

     1  package apifakes
     2  
     3  import "github.com/cloudfoundry/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  }