MCPcopy Create free account
hub / github.com/cloudfoundry/cli / UpdatePassword

Method UpdatePassword

api/uaa/user.go:165–187  ·  view source on GitHub ↗
(userGUID string, oldPassword string, newPassword string)

Source from the content-addressed store, hash-verified

163}
164
165func (client *Client) UpdatePassword(userGUID string, oldPassword string, newPassword string) error {
166 requestBody := map[string]interface{}{
167 "oldPassword": oldPassword,
168 "password": newPassword,
169 }
170
171 bodyBytes, err := json.Marshal(requestBody)
172 if err != nil {
173 return err
174 }
175
176 request, err := client.newRequest(requestOptions{
177 RequestName: internal.UpdatePasswordRequest,
178 Header: http.Header{"Content-Type": {"application/json"}},
179 URIParams: map[string]string{"user_guid": userGUID},
180 Body: bytes.NewBuffer(bodyBytes),
181 })
182 if err != nil {
183 return err
184 }
185
186 return client.connection.Make(request, &Response{})
187}
188
189func (client Client) ValidateClientUser(clientID string) error {
190 request, err := client.newRequest(requestOptions{

Callers

nothing calls this directly

Calls 2

newRequestMethod · 0.95
MakeMethod · 0.65

Tested by

no test coverage detected