Documentation
¶
Overview ¶
Package httpclient provides the *http.Client used for requests to the Serverless SSH CA.
Index ¶
Constants ¶
const ( // UserAgent is the product name sent in the User-Agent header UserAgent = "Serverless-SSH-CA-Client" // Timeout is the timeout for requests made by the client. A request may // need the CA to start, query its database, fetch the identity // provider's keys and sign a certificate, so it allows for a slow // response rather than failing a request that would succeed. Timeout = time.Second * 15 // MaxResponseSize is the largest response body read from the CA. Its // responses, including a revocation list, are far smaller, so this only // stops a misbehaving CA or a man in the middle using up memory. MaxResponseSize = 4 << 20 )
Variables ¶
var ErrResponseTooLarge = errors.New("response from the CA is too large")
ErrResponseTooLarge is returned when reading a response body larger than MaxResponseSize
Functions ¶
func GenerateUserAgent ¶
GenerateUserAgent returns a User-Agent header value for name that includes the version, OS and architecture.
func New ¶
New returns a *http.Client that sets the User-Agent header on all requests, has a timeout of Timeout, and fails to read a response body larger than MaxResponseSize.
Types ¶
This section is empty.