security

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Key  *KeyAuth
	Cert *CertAuth
	// contains filtered or unexported fields
}

Auth is a function auth

func (*Auth) RoundTripper

func (a *Auth) RoundTripper() (rt http.RoundTripper, err error)

RoundTripper wraps user provided round tripper for function with auth

func (*Auth) UnmarshalJSON

func (a *Auth) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type CertAuth

type CertAuth struct {
	Cert         []byte
	Key          []byte
	Renegotation tls.RenegotiationSupport
}

CertAuth is a certificate auth for function

func (CertAuth) RoundTripper

func (c CertAuth) RoundTripper() (http.RoundTripper, error)

RoundTripper returns round tripper for cert auth

func (*CertAuth) UnmarshalJSON

func (c *CertAuth) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type KeyAuth

type KeyAuth struct {
	Key  string
	Next http.RoundTripper
}

KeyAuth simple key based auth for function

func (KeyAuth) RoundTrip

func (k KeyAuth) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper

func (KeyAuth) RoundTripper

func (k KeyAuth) RoundTripper() (http.RoundTripper, error)

RoundTripper returns round tripper for key auth

func (*KeyAuth) UnmarshalJSON

func (k *KeyAuth) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Security

type Security struct {
	Auth
	Functions map[string]Auth
}

Security represents security configuration for function

func (Security) RoundTripper

func (s Security) RoundTripper(fn string) (http.RoundTripper, error)

RoundTripper returns roundtripper for function

Jump to

Keyboard shortcuts

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