Documentation
¶
Index ¶
- Constants
- 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 ¶
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 ¶
This section is empty.
Functions ¶
func ApplyAgentTokenHeaderMap ¶
ApplyAgentTokenHeaderMap mirrors ApplyAgentTokenHeaders for map-based header carriers. Same rationale: do not write Authorization here.
func ApplyAgentTokenHeaders ¶
ApplyAgentTokenHeaders sets the agent token in both X- header forms on the given http.Header. It deliberately does NOT set the Authorization header: these helpers are used by the manager when proxying user requests through to remote environments, and the Authorization header in that case carries the calling user's bearer or session token. Direct agent->manager call sites (poll, websocket dial, grpc dial, mTLS enroll) set `Authorization: Bearer <token>` themselves so the token survives reverse proxies that strip non-standard X- headers.
func ExtractBearerToken ¶
ExtractBearerToken returns the token portion of an "Authorization: Bearer <token>" header value. It is case-insensitive on the scheme and trims surrounding whitespace. Returns an empty string if the header is empty or does not use the Bearer scheme.
func RedactedTokenFingerprint ¶
RedactedTokenFingerprint returns a short, redacted identifier for a token suitable for debug logs. It is intentionally not reversible and never reveals the full secret.
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 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) 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