Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyAgentTokenHeaderMap(headers map[string]string, accessToken *string)
- func ApplyAgentTokenHeaders(headers http.Header, accessToken *string)
- func ExtractBearerToken(headerValue string) string
- func RedactedTokenFingerprint(token string) string
- type Client
- type DecodeError
- type Request
- type Response
- type StatusError
- type TransportError
- type TunnelTransport
- type TunnelTransportFuncs
Constants ¶
View Source
const ( HeaderAPIKey = "X-Api-Key" // #nosec G101: header name, not a credential HeaderAgentToken = "X-Arcane-Agent-Token" // #nosec G101: header name, not a credential HeaderAuthorization = "Authorization" )
Variables ¶
Functions ¶
func ApplyAgentTokenHeaderMap ¶
ApplyAgentTokenHeaderMap mirrors ApplyAgentTokenHeaders for map-based header carriers.
func ApplyAgentTokenHeaders ¶
ApplyAgentTokenHeaders sets the agent token in both X- header forms. It never sets Authorization, which carries the proxied user's own token.
func ExtractBearerToken ¶
ExtractBearerToken returns the trimmed token from an "Authorization: Bearer <token>" value, or "" when the scheme (case-insensitive) is not Bearer.
func RedactedTokenFingerprint ¶
RedactedTokenFingerprint returns a short, non-reversible token identifier for debug logs.
Types ¶
type DecodeError ¶
type DecodeError struct {
Err error
}
func (*DecodeError) Error ¶
func (e *DecodeError) Error() string
func (*DecodeError) Unwrap ¶
func (e *DecodeError) Unwrap() error
type Response ¶
func (*Response) RequireSuccess ¶
type StatusError ¶
func (*StatusError) Error ¶
func (e *StatusError) Error() string
type TransportError ¶
type TransportError struct {
Err error
}
func (*TransportError) Error ¶
func (e *TransportError) Error() string
func (*TransportError) Unavailable ¶ added in v2.11.0
func (e *TransportError) Unavailable() bool
Unavailable reports connection failures that permit using locally stored data. Invalid requests and failures reading an established response are not outages.
func (*TransportError) Unwrap ¶
func (e *TransportError) Unwrap() error
type TunnelTransport ¶
type TunnelTransportFuncs ¶
type TunnelTransportFuncs struct {
EnsureAvailableFunc func(ctx context.Context, envID string) error
DoFunc func(ctx context.Context, envID, method, path string, headers map[string]string, body []byte) (*Response, error)
}
func (TunnelTransportFuncs) EnsureAvailable ¶
func (t TunnelTransportFuncs) EnsureAvailable(ctx context.Context, envID string) error
Click to show internal directories.
Click to hide internal directories.