Documentation
¶
Overview ¶
Package neooracle provides API routes for the neooracle service.
Package neooracle provides HTTP handlers for the neooracle service.
Package oracle implements a simple oracle that can fetch external data and use secrets for auth.
Package neooracle provides a simple data-fetching neooracle service.
Index ¶
Constants ¶
View Source
const ( ServiceID = "neooracle" ServiceName = "NeoOracle Service" Version = "1.0.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Marble *marble.Marble
SecretProvider secrets.Provider
MaxBodyBytes int64 // optional response cap; default 2MB
URLAllowlist URLAllowlist // optional allowlist for outbound fetch
Timeout time.Duration
}
Config configures the oracle.
type QueryInput ¶
type QueryInput struct {
URL string `json:"url"`
Method string `json:"method,omitempty"` // default: GET
Headers map[string]string `json:"headers,omitempty"` // optional additional headers
SecretName string `json:"secret_name,omitempty"` // optional: fetch secret and send as Authorization bearer
SecretAsKey string `json:"secret_as_key,omitempty"` // optional: header key to place secret in (default Authorization: Bearer <secret>)
Body string `json:"body,omitempty"` // optional body for POST/PUT
}
QueryInput is the request payload to fetch external data.
type QueryResponse ¶
type QueryResponse struct {
StatusCode int `json:"status_code"`
Headers map[string]string `json:"headers"`
Body string `json:"body"`
}
QueryResponse returns the fetched data.
type Service ¶
type Service struct {
*commonservice.BaseService
// contains filtered or unexported fields
}
Service implements the oracle.
type URLAllowlist ¶
type URLAllowlist struct {
Prefixes []string
}
URLAllowlist defines allowed URL prefixes for outbound fetches. If empty, no restriction is applied (not recommended for production).
func (URLAllowlist) Allows ¶
func (a URLAllowlist) Allows(rawURL string) bool
Click to show internal directories.
Click to hide internal directories.