authorizers

package
v0.0.0-...-6c3212e Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllowCtr = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "choria_aaa_authorizer_allowed",
		Help: "Total number of requests that were allowed",
	}, []string{"site", "authorizer", "action"})

	DenyCtr = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "choria_aaa_authorizer_denied",
		Help: "Total number of requests that were denied",
	}, []string{"site", "authorizer", "action"})

	ErrCtr = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "choria_aaa_authorizer_errors",
		Help: "Total number of requests could not be authorized",
	}, []string{"site", "authorizer"})
)

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	// Authorize should check if the request should be allowed
	Authorize(req protocol.Request, claims *tokens.ClientIDClaims) (allow bool, err error)
}

Authorizer is used to authorize a request based on its JWT claims

Directories

Path Synopsis
Package actionlist is a Authorizer that looks at specific claims in a JWT token and allow requests based on the approved list of actions.
Package actionlist is a Authorizer that looks at specific claims in a JWT token and allow requests based on the approved list of actions.
Package opa is a Authorizer that reads Open Policy Agent Rego policies from a `opa_policy` claim in a JWT token and allow requests based on evaluation of the policy
Package opa is a Authorizer that reads Open Policy Agent Rego policies from a `opa_policy` claim in a JWT token and allow requests based on evaluation of the policy

Jump to

Keyboard shortcuts

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