server

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PoliciesValidateHandler

func PoliciesValidateHandler(_ *config.Conf) gin.HandlerFunc

PoliciesValidateHandler @Tags Policies Validate @Summary Validate the policies @description Validate the policies @Accept json @Produce json @Router /validate/policies [POST] @Param policyList body validatePolicyList true "policyList" @Success 200 {object} ValidateResponse "OK" @Failure 400 {object} ErrorResult "Bad Request" @Failure 500 {object} ErrorResult "Internal Server Error" @Failure 502 {object} ErrorResult "Bad Gateway"

func PolicyEval

func PolicyEval(policyRego string, policyQuery string, input interface{}) (results rego.ResultSet, err error)

func RunHTTPServer

func RunHTTPServer(ctx context.Context, cfg *config.Conf) error

Types

type ErrorResult

type ErrorResult struct {
	ErrMsg string `json:"err_msg,omitempty" binding:"required"`

} // @name ErrorResult

type ValidateResponse

type ValidateResponse struct {
	IsSuccessful bool   `json:"isSuccessful" binding:"required"`
	Policy       string `json:"policy,omitempty" binding:"required"`
	ErrMsg       string `json:"err_msg,omitempty" binding:"required"`

} // @name ValidateResponse

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL