identifier

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 26

Documentation

Overview

Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.

Package identifier provides handlers for associating identity information with incoming requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientCertificates added in v0.50.0

func ClientCertificates(r *http.Request) ([]*x509.Certificate, bool)

ClientCertificates returns the ClientCertificates of the caller associated with ctx.

func Identity

func Identity(r *http.Request) (string, bool)

Identity returns the identity of the caller associated with ctx.

func SetClientCertificates added in v0.50.0

func SetClientCertificates(r *http.Request, v []*x509.Certificate) *http.Request

SetClientCertificates returns a new http.Request with the ClientCertificates set to v.

func SetIdentity

func SetIdentity(r *http.Request, v string) *http.Request

SetIdentity returns a new http.Request with the identity set to v.

Types

type TLSBased added in v0.10.3

type TLSBased = v1.TLSBased

TLSBased extracts the CN of the client's TLS ceritificate

func NewTLSBased added in v0.10.3

func NewTLSBased(inner http.Handler) *TLSBased

NewTLSBased returns a new TLSBased object.

type TokenBased

type TokenBased = v1.TokenBased

TokenBased extracts Bearer tokens from the request.

func NewTokenBased

func NewTokenBased(inner http.Handler) *TokenBased

NewTokenBased returns a new TokenBased object.

Jump to

Keyboard shortcuts

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