Documentation ¶
Index ¶
- Constants
- Variables
- func EvaluateRequest(req *http.Request, env config.EnvironmentVariables, w http.ResponseWriter, ...) error
- func OPAMiddleware(opaModuleConfig *core.OPAModuleConfig, sdkState *SDKBootState, ...) mux.MiddlewareFunc
- func ReverseProxy(logger *logrus.Entry, env config.EnvironmentVariables, w http.ResponseWriter, ...)
- func ReverseProxyOrResponse(logger *logrus.Entry, env config.EnvironmentVariables, w http.ResponseWriter, ...)
- func SetupRouter(log *logrus.Logger, env config.EnvironmentVariables, ...) (*mux.Router, error)
- func StatusRoutes(r *mux.Router, sdkBoot *SDKBootState, serviceName, serviceVersion string)
- type GrantRequestBody
- type GrantResponseBody
- type OPAMiddlewareOptions
- type OPATransport
- type RevokeRequestBody
- type RevokeResponseBody
- type SDKBootState
- type StatusResponse
Constants ¶
View Source
const BASE_ROW_FILTER_HEADER_KEY = "acl_rows"
View Source
const BINDINGS_MAX_PAGE_SIZE = 200
TODO: handle pagination!
View Source
const URL_SCHEME = "http"
Variables ¶
View Source
var ( ErrUnexepectedContentType = fmt.Errorf("unexpected content type") ErrOPATransportInvalidResponseBody = fmt.Errorf("response body is not valid") )
View Source
var ( ErrSDKNotReadyMessage = "service not ready to work yet" ErrSDKNotReadyBusinessMessage = "the service is not ready to work yet, try again in a few moments" )
Functions ¶
func EvaluateRequest ¶
func OPAMiddleware ¶ added in v1.9.0
func OPAMiddleware( opaModuleConfig *core.OPAModuleConfig, sdkState *SDKBootState, routesToNotProxy []string, targetServiceOASPath string, options *OPAMiddlewareOptions, ) mux.MiddlewareFunc
func ReverseProxy ¶
func ReverseProxy( logger *logrus.Entry, env config.EnvironmentVariables, w http.ResponseWriter, req *http.Request, permission *core.RondConfig, evaluatorSdk sdk.Evaluator, inputUser core.InputUser, )
func ReverseProxyOrResponse ¶
func SetupRouter ¶
func SetupRouter( log *logrus.Logger, env config.EnvironmentVariables, opaModuleConfig *core.OPAModuleConfig, oas *openapi.OpenAPISpec, sdkBoot *SDKBootState, inputUserClient inputuser.Client, registry *prometheus.Registry, ) (*mux.Router, error)
func StatusRoutes ¶
func StatusRoutes(r *mux.Router, sdkBoot *SDKBootState, serviceName, serviceVersion string)
StatusRoutes add status routes to router.
Types ¶
type GrantRequestBody ¶
type GrantResponseBody ¶
type GrantResponseBody struct {
BindingID string `json:"bindingId"`
}
type OPAMiddlewareOptions ¶ added in v1.9.0
type OPATransport ¶ added in v1.9.0
type OPATransport struct { http.RoundTripper // contains filtered or unexported fields }
func NewOPATransport ¶ added in v1.9.0
func NewOPATransport( transport http.RoundTripper, context context.Context, config *core.RondConfig, env config.EnvironmentVariables, logger *logrus.Entry, req *http.Request, clientHeaderKey string, user core.InputUser, evaluatorSDK sdk.Evaluator, ) *OPATransport
type RevokeRequestBody ¶
type RevokeResponseBody ¶
type SDKBootState ¶ added in v1.11.0
type SDKBootState struct {
// contains filtered or unexported fields
}
func NewSDKBootState ¶ added in v1.11.0
func NewSDKBootState() *SDKBootState
func (*SDKBootState) Get ¶ added in v1.11.0
func (s *SDKBootState) Get() sdk.OASEvaluatorFinder
func (*SDKBootState) IsReady ¶ added in v1.13.0
func (s *SDKBootState) IsReady() bool
func (*SDKBootState) IsReadyChan ¶ added in v1.13.0
func (s *SDKBootState) IsReadyChan() chan bool
func (*SDKBootState) Ready ¶ added in v1.11.0
func (s *SDKBootState) Ready(rond sdk.OASEvaluatorFinder)
type StatusResponse ¶
type StatusResponse struct { Status string `json:"status"` Name string `json:"name"` Version string `json:"version"` }
StatusResponse type.
Click to show internal directories.
Click to hide internal directories.