Documentation ¶
Overview ¶
Package opahttp implements the authz.Authorizer using an Open Policy Agent (OPA).
Index ¶
Constants ¶
const ( DefaultHostURL = "http://localhost:8181" DefaultAPIPath = "/v1/data/entroq/authz" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OPA ¶
type OPA struct {
// contains filtered or unexported fields
}
OPA is a client-like object for interacting with OPA authorization policies. It adheres to the authz.Authorizer interface.
type Option ¶
type Option func(*OPA)
Option defines a setting for creating an OPA authorizer.
func WithAPIPath ¶
WithAPIPath sets the API path to request for authorization.
func WithHostURL ¶
WithHostURL sets the host OPA URL for a query authorization request, such as its default value given in DefaultURL.
func WithInsecureTestUser ¶
func WithInsecureTestUser() Option
WithInsecureTestUser must be set when doing testing and the use of the Authz.TestUser (instead of a signed token, for example) is desired. Without this option, the presence of the TestUser field causes an error.