package rest
import "github.com/open-policy-agent/opa/plugins/rest"
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.
Package rest implements a REST client for communicating with remote services.
Index ¶
- func AuthPluginLookup(l AuthPluginLookupFunc) func(*Client)
- func DefaultRoundTripperClient(t *tls.Config, timeout int64) *http.Client
- func DefaultTLSConfig(c Config) (*tls.Config, error)
- func DistributedTracingOpts(tr tracing.Options) func(*Client)
- func Logger(l logging.Logger) func(*Client)
- func Name(s string) func(*Client)
- type AccessToken
- type AuthPluginLookupFunc
- type Client
- type Config
- type HTTPAuthPlugin
Functions ¶
func AuthPluginLookup ¶
func AuthPluginLookup(l AuthPluginLookupFunc) func(*Client)
AuthPluginLookup assigns a function to lookup an HTTPAuthPlugin to a new Client. It's intended to be used when creating a Client using New(). Usually this is passed the plugins.AuthPlugin func, which retrieves a registered HTTPAuthPlugin from the plugin manager.
func DefaultRoundTripperClient ¶
DefaultRoundTripperClient is a reasonable set of defaults for HTTP auth plugins
func DefaultTLSConfig ¶
DefaultTLSConfig defines standard TLS configurations based on the Config
func DistributedTracingOpts ¶
DistributedTracingOpts sets the options to be used by distributed tracing.
func Logger ¶
Logger assigns a logger to the client
func Name ¶
Name returns an option that overrides the service name on the client.
Types ¶
type AccessToken ¶
type AccessToken = v1.AccessToken
AccessToken holds a GCP access token.
type AuthPluginLookupFunc ¶
type AuthPluginLookupFunc = v1.AuthPluginLookupFunc
An AuthPluginLookupFunc can lookup auth plugins by their name.
type Client ¶
Client implements an HTTP/REST client for communicating with remote services.
func New ¶
New returns a new Client for config.
type Config ¶
Config represents configuration for a REST client.
type HTTPAuthPlugin ¶
type HTTPAuthPlugin = v1.HTTPAuthPlugin
An HTTPAuthPlugin represents a mechanism to construct and configure HTTP authentication for a REST service
Source Files ¶
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 4 hours ago –
Tools for package owners.