certextractor

package
v2.7.3 Latest Latest
Warning

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

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

Documentation

Overview

Package certextractor implements a filter to extract given field from TLS.

Index

Constants

View Source
const (
	// Kind is the kind of CertExtractor.
	Kind = "CertExtractor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CertExtractor

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

CertExtractor extracts given field from TLS certificates and sets it to request headers.

func (*CertExtractor) Close

func (ce *CertExtractor) Close()

Close closes CertExtractor.

func (*CertExtractor) Handle

func (ce *CertExtractor) Handle(ctx *context.Context) string

Handle retrieves header values and sets request headers.

func (*CertExtractor) Inherit

func (ce *CertExtractor) Inherit(previousGeneration filters.Filter)

Inherit inherits previous generation of CertExtractor.

func (*CertExtractor) Init

func (ce *CertExtractor) Init()

Init initializes CertExtractor.

func (*CertExtractor) Kind

func (ce *CertExtractor) Kind() *filters.Kind

Kind returns the kind of CertExtractor.

func (*CertExtractor) Name

func (ce *CertExtractor) Name() string

Name returns the name of the CertExtractor filter instance.

func (*CertExtractor) Spec

func (ce *CertExtractor) Spec() filters.Spec

Spec returns the spec used by the CertExtractor

func (*CertExtractor) Status

func (ce *CertExtractor) Status() interface{}

Status returns status.

type Spec

type Spec struct {
	filters.BaseSpec `json:",inline"`

	CertIndex int16  `json:"certIndex" jsonschema:"required"`
	Target    string `json:"target" jsonschema:"required,enum=subject,enum=issuer"`
	// Different field options listed here https://pkg.go.dev/crypto/x509/pkix#Name
	Field     string `` /* 186-byte string literal not displayed */
	HeaderKey string `json:"headerKey" jsonschema:"required"`
}

Spec describes the CertExtractor.

func (*Spec) Validate

func (spec *Spec) Validate() error

Validate is dummy as jsonschema has already validated Spec.

Jump to

Keyboard shortcuts

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