github.com/ablease/cli@v6.37.1-0.20180613014814-3adbb7d7fb19+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  }