Documentation
¶
Overview ¶
Package serviceapi provides an HTTP client for internal LFX service APIs authenticated with OAuth2 client credentials (M2M bearer tokens). These services (e.g., Member Onboarding, LFX Lens) have no per-user authorization — the MCP server enforces access control via the V2 access-check endpoint before proxying requests here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client for an internal service API.
func (*Client) Get ¶
Get performs a GET request to the given path with optional query parameters. Returns the response body, HTTP status code, and any error.
func (*Client) PostJSON ¶
PostJSON performs a POST request with a JSON body. Returns the response body, HTTP status code, and any error.
func (*Client) PostMultipart ¶
func (c *Client) PostMultipart(ctx context.Context, path string, fields map[string]string) ([]byte, int, error)
PostMultipart performs a POST request with a multipart/form-data body. This is used for AgentOS endpoints that accept multipart form submissions. Returns the response body, HTTP status code, and any error.
type Config ¶
type Config struct {
// BaseURL is the root URL of the service API (e.g., "https://onboarding.lfx.internal").
BaseURL string
// TokenSource provides bearer tokens for request authentication.
TokenSource TokenSource
// HTTPClient is the HTTP client to use. If nil, a default client with 30s
// timeout is created.
HTTPClient *http.Client
// DebugLogger enables wire-level request/response logging when non-nil.
DebugLogger *slog.Logger
}
Config holds configuration for a service API client.