Documentation
¶
Index ¶
- func GenerateNonce() string
- func ParseErrorResponse(resp *http.Response) error
- func ParsePrivateKey(raw ed25519.PrivateKey, hexKey, base64Key string) (ed25519.PrivateKey, error)
- type APIError
- type Auth
- type Config
- type ErrorResponse
- type TLSConfig
- type Transport
- func (t *Transport) BaseURL() string
- func (t *Transport) Request(ctx context.Context, method, path string, body interface{}, result interface{}, ...) error
- func (t *Transport) RequestNoAuth(ctx context.Context, method, path string) (*http.Response, error)
- func (t *Transport) RequestRaw(ctx context.Context, method, path string, body []byte, acceptedStatuses ...int) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateNonce ¶
func GenerateNonce() string
GenerateNonce generates a random nonce for replay protection. Returns a 16-byte random value encoded as hex (32 characters).
func ParseErrorResponse ¶
ParseErrorResponse parses an error response from the API.
func ParsePrivateKey ¶
func ParsePrivateKey(raw ed25519.PrivateKey, hexKey, base64Key string) (ed25519.PrivateKey, error)
ParsePrivateKey parses a private key from various formats. Supports: raw ed25519.PrivateKey, hex string, base64 DER.
Types ¶
type APIError ¶
APIError represents an error returned by the remote-signer API. Defined here so transport can construct it; re-exported from the root client package.
func (*APIError) IsStatusCode ¶
IsStatusCode checks if the error has the given HTTP status code.
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth handles Ed25519 request signing.
func NewAuth ¶
func NewAuth(privateKey ed25519.PrivateKey) *Auth
NewAuth creates a new Auth from a private key.
type ErrorResponse ¶
ErrorResponse represents an error response from the API.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport handles HTTP communication with the remote-signer service.
func NewTransport ¶
NewTransport creates a new Transport with the given configuration.
func (*Transport) Request ¶
func (t *Transport) Request(ctx context.Context, method, path string, body interface{}, result interface{}, acceptedStatuses ...int) error
Request performs an authenticated JSON request and decodes the response into result.
func (*Transport) RequestNoAuth ¶
RequestNoAuth performs an unauthenticated request (for /health, /metrics).