Documentation
¶
Index ¶
Constants ¶
const ( // HeaderObotAPIKey carries an Obot API key alongside another credential, on LLM proxy // requests. HeaderObotAPIKey = "X-Obot-Api-Key" )
Variables ¶
This section is empty.
Functions ¶
func NewGatewayTokenReviewer ¶ added in v0.8.0
func NewGatewayTokenReviewer(gatewayClient *client.Client, dispatcher *dispatcher.Dispatcher) authenticator.Request
Types ¶
type APIKeyAuthenticator ¶ added in v0.16.0
type APIKeyAuthenticator struct {
// contains filtered or unexported fields
}
APIKeyAuthenticator authenticates requests using API keys. API key users have restricted access - they only get GroupAPIKey, not the full authenticated user groups.
func NewAPIKeyAuthenticator ¶ added in v0.16.0
func NewAPIKeyAuthenticator(client *client.Client) *APIKeyAuthenticator
NewAPIKeyAuthenticator creates a new API key authenticator.
func (*APIKeyAuthenticator) AuthenticateRequest ¶ added in v0.16.0
func (a *APIKeyAuthenticator) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error)
AuthenticateRequest implements authenticator.Request.
type DeviceAuthenticator ¶ added in v0.24.0
type DeviceAuthenticator struct {
// contains filtered or unexported fields
}
DeviceAuthenticator authenticates an enrolled device by a short-lived JWT the device signs itself with its identity key. There is no server-minted token: the JWT is verified against the public key registered at enrollment. The resulting principal is the device (device:<device_id>), scoped to submitting and reading its own device scans, so an unattended device can submit a scan attributed to itself.
func NewDeviceAuthenticator ¶ added in v0.24.0
func NewDeviceAuthenticator(client *client.Client) *DeviceAuthenticator
NewDeviceAuthenticator creates a new device access-JWT authenticator.
func (*DeviceAuthenticator) AuthenticateRequest ¶ added in v0.24.0
func (a *DeviceAuthenticator) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error)
AuthenticateRequest implements authenticator.Request.
type DeviceEnrollmentAuthenticator ¶ added in v0.24.0
type DeviceEnrollmentAuthenticator struct {
// contains filtered or unexported fields
}
DeviceEnrollmentAuthenticator authenticates device-enrollment credentials (ode1-<configuration_id>-<key_id>-<secret>).
The resulting principal IS the MDMConfiguration the credential belongs to: its Name/UID is the configuration's namespaced identity (mdm-configuration:<id>) and its capability group is DeviceEnroll, authorizing the enrollment endpoint. The configuration id is stashed in Extra for the enroll handler to record on the device.
This mirrors APIKeyAuthenticator, but yields a non-user principal — there is no gateway user behind an enrollment credential — so it must be placed after the UserDecorator in the authenticator union.
func NewDeviceEnrollmentAuthenticator ¶ added in v0.24.0
func NewDeviceEnrollmentAuthenticator(client *client.Client) *DeviceEnrollmentAuthenticator
NewDeviceEnrollmentAuthenticator creates a new device-enrollment authenticator.
func (*DeviceEnrollmentAuthenticator) AuthenticateRequest ¶ added in v0.24.0
func (a *DeviceEnrollmentAuthenticator) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error)
AuthenticateRequest implements authenticator.Request.
type Options ¶
type Options struct {
Hostname string
UIHostname string `name:"ui-hostname" env:"OBOT_SERVER_UI_HOSTNAME"`
// The daily token limits seed the LLM gateway's "Daily token limit" budget on every profile
// the first time it starts.
DailyUserInputTokenLimit int `` // default is 10 million
/* 175-byte string literal not displayed */
DailyUserOutputTokenLimit int `` // default is 100 thousand
/* 174-byte string literal not displayed */
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(db *db.DB, tokenService *persistent.TokenService, modelProviderDispatcher *dispatcher.Dispatcher, acrHelper *accesscontrolrule.Helper, mapHelper *modelaccesspolicy.Helper, opts Options) (*Server, error)
func (*Server) LLMGateway ¶ added in v0.28.0
LLMGateway returns the embedded Bifrost gateway.
func (*Server) SetLLMGateway ¶ added in v0.28.0
SetLLMGateway attaches the embedded Bifrost gateway, enabling the /api/llm-proxy/v1 routes.
type TesterAudit ¶ added in v0.26.0
type TesterAudit struct {
// contains filtered or unexported fields
}
func NewTesterAudit ¶ added in v0.26.0
func NewTesterAudit(c *client.Client, inbound *http.Request, user user.Info, body []byte) *TesterAudit
NewTesterAudit reuses gateway audit capture and persistence without invoking gateway dispatch, token metering, budgets or guardrails. Caller identity comes from the inbound request and is never attached to the external request.
Source Files
¶
- activeusers.go
- apikey.go
- apikey_auth.go
- device_auth.go
- deviceenroll_auth.go
- grouproleassignment.go
- llmaudit.go
- llmproxy.go
- llmproxy_anthropic.go
- llmproxy_engine.go
- llmproxy_legacy.go
- llmproxy_response.go
- llmproxy_usage.go
- llmusage.go
- logout_all.go
- middleware.go
- oauth.go
- response.go
- router.go
- server.go
- testeraudit.go
- token.go
- tokenreview.go
- usage.go
- user.go