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

Method ValidateClientUser

api/uaa/user.go:189–212  ·  view source on GitHub ↗
(clientID string)

Source from the content-addressed store, hash-verified

187}
188
189func (client Client) ValidateClientUser(clientID string) error {
190 request, err := client.newRequest(requestOptions{
191 RequestName: internal.GetClientUser,
192 Header: http.Header{
193 "Content-Type": {"application/json"},
194 },
195 URIParams: map[string]string{"client_id": clientID},
196 })
197 if err != nil {
198 return err
199 }
200 err = client.connection.Make(request, &Response{})
201
202 if errType, ok := err.(RawHTTPStatusError); ok {
203 switch errType.StatusCode {
204 case http.StatusNotFound:
205 return actionerror.UserNotFoundError{Username: clientID}
206 case http.StatusForbidden:
207 return InsufficientScopeError{}
208 }
209 }
210
211 return err
212}

Callers

nothing calls this directly

Calls 2

newRequestMethod · 0.95
MakeMethod · 0.65

Tested by

no test coverage detected