package server
import "github.com/open-policy-agent/opa/server"
Package server contains the policy engine's server handlers.
Index ¶
- type AuthenticationScheme
- type AuthorizationScheme
- type Server
- func New() *Server
- func (s *Server) Compiler() *ast.Compiler
- func (s *Server) Init(ctx context.Context) (*Server, error)
- func (s *Server) Listeners() (func() error, func() error)
- func (s *Server) WithAddress(addr string) *Server
- func (s *Server) WithAuthentication(scheme AuthenticationScheme) *Server
- func (s *Server) WithAuthorization(scheme AuthorizationScheme) *Server
- func (s *Server) WithCertificate(cert *tls.Certificate) *Server
- func (s *Server) WithInsecureAddress(addr string) *Server
- func (s *Server) WithStorage(store *storage.Storage) *Server
Types ¶
type AuthenticationScheme ¶
type AuthenticationScheme int
AuthenticationScheme enumerates the supported authentication schemes. The authentication scheme determines how client identities are established.
const ( AuthenticationOff AuthenticationScheme = iota AuthenticationToken = iota )
Set of supported authentication schemes.
type AuthorizationScheme ¶
type AuthorizationScheme int
AuthorizationScheme enumerates the supported authorization schemes. The authorization scheme determines how access to OPA is controlled.
const ( AuthorizationOff AuthorizationScheme = iota AuthorizationBasic = iota )
Set of supported authorization schemes.
type Server ¶
Server represents an instance of OPA running in server mode.
func New ¶
func New() *Server
New returns a new Server.
func (*Server) Compiler ¶
Compiler returns the server's compiler.
The server's compiler contains the compiled versions of all modules added to the server as well as data structures for performing query analysis. This is intended to allow services to embed the OPA server while still relying on the topdown package for query evaluation.
func (*Server) Init ¶
Init initializes the server. This function MUST be called before Loop.
func (*Server) Listeners ¶
Listeners returns functions that listen and serve connections.
func (*Server) WithAddress ¶
WithAddress sets the listening address that the server will bind to.
func (*Server) WithAuthentication ¶
func (s *Server) WithAuthentication(scheme AuthenticationScheme) *Server
WithAuthentication sets authentication scheme to use on the server.
func (*Server) WithAuthorization ¶
func (s *Server) WithAuthorization(scheme AuthorizationScheme) *Server
WithAuthorization sets authorization scheme to use on the server.
func (*Server) WithCertificate ¶
func (s *Server) WithCertificate(cert *tls.Certificate) *Server
WithCertificate sets the server-side certificate that the server will use.
func (*Server) WithInsecureAddress ¶
WithInsecureAddress sets the listening address that the server will bind to.
func (*Server) WithStorage ¶
WithStorage sets the storage used by the server.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
server/authorizer | Package authorizer provides authorization handlers to the server. |
server/identifier | Package identifier provides handlers for associating an identity with incoming requests. |
server/types | Package types contains request/response types and codes for the server. |
server/writer | Package writer contains utilities for writing responses in the server. |
- Version
- v0.4.8
- Published
- Apr 5, 2017
- Platform
- js/wasm
- Imports
- 24 packages
- Last checked
- 2 hours ago –
Tools for package owners.