httpclient

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpclient provides the *http.Client used for requests to the Serverless SSH CA.

Index

Constants

View Source
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

View Source
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

func GenerateUserAgent(name string) string

GenerateUserAgent returns a User-Agent header value for name that includes the version, OS and architecture.

func New

func New() *http.Client

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL