auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package auth holds shared, transport-agnostic data types and helpers for describing how AX authenticates outbound calls to remote agents and what extra headers to attach.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeAllHeaders

func MergeAllHeaders(a Auth, h Headers, apiKeyHeader string) (map[string]string, error)

MergeAllHeaders flattens user-supplied Headers and the auth-resolved header into a single map[string]string applied to every outgoing request. Returns (nil, nil) when no headers are produced.

Types

type Auth

type Auth struct {
	Type          string `yaml:"type"`           // "api_key" or "bearer"
	CredentialEnv string `yaml:"credential_env"` // env var holding credential value
}

Auth describes how AX authenticates to a remote agent. Two well-known schemes are supported, both sourcing their credential value from a single environment variable named in CredentialEnv:

  • "api_key": the credential is injected into a single HTTP header. For A2A consumers, the header name is determined at runtime from the agent's APIKeySecurityScheme on the AgentCard.
  • "bearer": the credential is injected as "Authorization: Bearer <value>".

type Headers

type Headers struct {
	Literal map[string]string `yaml:"literal,omitempty"` // literal values (NOT secret-safe)
	Env     map[string]string `yaml:"env,omitempty"`     // header name -> env var name (secret-safe)
}

Headers is a reusable bundle of HTTP-style header values, with both literal and env-sourced sources.

Jump to

Keyboard shortcuts

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