request performs the common logic for Sign and Info, performing the actual request and returning the resultant certificate.
(jsonData []byte, target string)
| 296 | // request performs the common logic for Sign and Info, performing the actual |
| 297 | // request and returning the resultant certificate. |
| 298 | func (srv *server) request(jsonData []byte, target string) ([]byte, error) { |
| 299 | result, err := srv.getResultMap(jsonData, target) |
| 300 | if err != nil { |
| 301 | return nil, err |
| 302 | } |
| 303 | cert := result["certificate"].(string) |
| 304 | if cert != "" { |
| 305 | return []byte(cert), nil |
| 306 | } |
| 307 | |
| 308 | return nil, errors.Wrap(errors.APIClientError, errors.ClientHTTPError, stderr.New("response doesn't contain certificate.")) |
| 309 | } |
| 310 | |
| 311 | // AuthRemote acts as a Remote with a default Provider for AuthSign. |
| 312 | type AuthRemote struct { |
no test coverage detected