opa: github.com/open-policy-agent/opa/server/identifier Index | Files

package identifier

import "github.com/open-policy-agent/opa/server/identifier"

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

Index

Package Files

identifier.go tls.go

func Identity Uses

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

Identity returns the identity of the caller associated with ctx.

func SetIdentity Uses

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

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

type TLSBased Uses

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

TLSBased extracts the CN of the client's TLS ceritificate

func NewTLSBased Uses

func NewTLSBased(inner http.Handler) *TLSBased

NewTLSBased returns a new TLSBased object.

func (*TLSBased) ServeHTTP Uses

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

type TokenBased Uses

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

TokenBased extracts Bearer tokens from the request.

func NewTokenBased Uses

func NewTokenBased(inner http.Handler) *TokenBased

NewTokenBased returns a new TokenBased object.

func (*TokenBased) ServeHTTP Uses

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

Package identifier imports 3 packages (graph) and is imported by 12 packages. Updated 2019-02-11. Refresh now. Tools for package owners.