Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoAPIURL = errors.New("API URL is required (set ADAPTO_CLI_API_URL or --api-url)")
ErrNoAPIURL is returned when no Management API base URL has been configured.
var ErrSessionExpired = errors.New("session expired — run 'adapto auth login' to sign in again")
ErrSessionExpired is returned when a 401 could not be recovered by refreshing.
Functions ¶
func New ¶
func New(cfg config.Config) (*client.ClientWithResponses, error)
New creates a ClientWithResponses that injects Bearer token and X-Tenant-ID headers.
func NewHTTPClient ¶ added in v0.1.4
NewHTTPClient returns the http.Client used for Management API calls: verbose request/response dumping when enabled, plus a one-shot token refresh on 401.
Routes that the generated OpenAPI client does not cover yet are issued by hand against this client so they behave like every other API call. It must not be used for uploads to S3 presigned URLs: those carry their own credentials in the query string, and the verbose transport would dump the entire request body.
func SetAPIHeaders ¶ added in v0.1.4
SetAPIHeaders applies the headers every Management API request carries.
These identify the caller to the Adapto API and must never be copied onto a presigned S3 PUT: the signature does not cover them and S3 answers with an opaque 403.
Types ¶
This section is empty.