identifier

package
v0.62.1 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: 4 Imported by: 29 modules, 30 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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 struct {
	// contains filtered or unexported fields
}

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.

func (*TLSBased) ServeHTTP added in v0.10.3

func (h *TLSBased) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TokenBased

type TokenBased struct {
	// contains filtered or unexported fields
}

TokenBased extracts Bearer tokens from the request.

func NewTokenBased

func NewTokenBased(inner http.Handler) *TokenBased

NewTokenBased returns a new TokenBased object.

func (*TokenBased) ServeHTTP

func (h *TokenBased) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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