Documentation
¶
Index ¶
- Variables
- type Client
- type GroundTruth
- type Response
- type SecureClient
- func (s *SecureClient) AddHeader(requestID int64, key string, value string) error
- func (s *SecureClient) ExecuteRequest(requestID int64) (*Response, error)
- func (s *SecureClient) Get(url string, headers map[string]string) (*Response, error)
- func (s *SecureClient) GroundTruth() *GroundTruth
- func (s *SecureClient) HTTPClient() (*http.Client, error)
- func (s *SecureClient) InitGetRequest(url string) (int64, error)
- func (s *SecureClient) InitPostRequest(url string, body []byte) (int64, error)
- func (s *SecureClient) Post(url string, headers map[string]string, body []byte) (*Response, error)
- func (s *SecureClient) Verify() (*GroundTruth, error)
- type TLSBoundRoundTripper
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client wraps the OpenAI client to work with Tinfoil
func NewClient ¶
func NewClient(openaiOpts ...option.RequestOption) (*Client, error)
NewClient creates a new secure OpenAI client using environment variables for configuration
func NewClientWithParams ¶
func NewClientWithParams(enclave, repo string, openaiOpts ...option.RequestOption) (*Client, error)
NewClientWithParams creates a new secure OpenAI client with explicit enclave and repo parameters
type GroundTruth ¶
GroundTruth represents the "known good" verified state of the enclave
type SecureClient ¶
type SecureClient struct {
// contains filtered or unexported fields
}
SecureClient provides a way to securely communicate with a verified enclave
func NewSecureClient ¶
func NewSecureClient(enclave, repo string) *SecureClient
NewSecureClient creates a new client for secure communications with the enclave
func (*SecureClient) AddHeader ¶
func (s *SecureClient) AddHeader(requestID int64, key string, value string) error
AddHeader adds a header to a pending request
func (*SecureClient) ExecuteRequest ¶
func (s *SecureClient) ExecuteRequest(requestID int64) (*Response, error)
ExecuteRequest executes a pending request and returns the response
func (*SecureClient) GroundTruth ¶
func (s *SecureClient) GroundTruth() *GroundTruth
GroundTruth returns the last verified enclave state
func (*SecureClient) HTTPClient ¶
func (s *SecureClient) HTTPClient() (*http.Client, error)
HTTPClient returns an HTTP client that only accepts TLS connections to the verified enclave
func (*SecureClient) InitGetRequest ¶
func (s *SecureClient) InitGetRequest(url string) (int64, error)
InitGetRequest initializes a new GET request and returns a unique request ID
func (*SecureClient) InitPostRequest ¶
func (s *SecureClient) InitPostRequest(url string, body []byte) (int64, error)
InitPostRequest initializes a new POST request and returns a unique request ID
func (*SecureClient) Verify ¶
func (s *SecureClient) Verify() (*GroundTruth, error)
Verify fetches the latest verification information from GitHub and Sigstore and stores the ground truth results in the client