Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CelAuthorizer ¶
type CelAuthorizer struct {
// contains filtered or unexported fields
}
CelAuthorizer is a Common Expression Language vm that uses CEL expressions to authorize grpc requests
func NewCelAuthorizer ¶
NewCelAuthorizer returns a new CelAuthorizer. The rules map is a map of method names to RuleSets. The RuleSets are used to authorize the method. The RuleSets are evaluated in order and the first rule that evaluates to true will authorize the request. The mapping can be generated with the protoc-gen-authorize plugin.
func (*CelAuthorizer) AuthorizeMethod ¶
func (c *CelAuthorizer) AuthorizeMethod(ctx context.Context, method string, params *authorizer.RuleExecutionParams) (bool, error)
AuthorizeMethod authorizes a gRPC method the RuleExecutionParams and returns a boolean representing whether the request is authorized or not.
type Opt ¶ added in v0.5.0
type Opt func(*CelAuthorizer)
Opt is a functional option for configuring a CelAuthorizer
func WithMacros ¶ added in v0.5.0
WithMacros sets additional macros that will be available to the cel vm Please note that the standard macros are already included