pubkey

package
v5.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pubkey represents the public key updater fetching logic and the interface

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFetchAthenzPubkey "Fetch athenz pubkey error"
	ErrFetchAthenzPubkey = errors.New("Fetch athenz pubkey error")

	// ErrEmptyAthenzPubkey "Athenz pubkey not initialized"
	ErrEmptyAthenzPubkey = errors.New("Athenz pubkey not initialized")
)

Functions

This section is empty.

Types

type AthenzConfig

type AthenzConfig struct {
	ZMSPubKeys *sync.Map //map[string]authcore.Verifier
	ZTSPubKeys *sync.Map //map[string]authcore.Verifier
}

AthenzConfig represent the cache of Athenz config.

type AthenzEnv

type AthenzEnv string

AthenzEnv represent the athenz environment name.

const (
	// EnvZMS represent the ZMS environment name.
	EnvZMS AthenzEnv = "zms"

	// EnvZTS represent the ZTS environment name.
	EnvZTS AthenzEnv = "zts"
)

type Daemon

type Daemon interface {
	Start(ctx context.Context) <-chan error
	Update(context.Context) error
	GetProvider() Provider
}

Daemon represent the daemon to retrieve public key data.

func New

func New(opts ...Option) (Daemon, error)

New represent the constructor of Pubkeyd

type Option

type Option func(*pubkeyd) error

Option represents a functional option

func WithAthenzURL

func WithAthenzURL(url string) Option

WithAthenzURL returns an AthenzURL functional option

func WithETagExpiry

func WithETagExpiry(d string) Option

WithETagExpiry returns an ETagExpiry functional option

func WithETagPurgePeriod

func WithETagPurgePeriod(d string) Option

WithETagPurgePeriod returns an ETagPurgePeriod functional option

func WithHTTPClient

func WithHTTPClient(cl *http.Client) Option

WithHTTPClient returns a HTTPClient functional option

func WithRefreshPeriod

func WithRefreshPeriod(t string) Option

WithRefreshPeriod returns a RefreshPeriod functional option

func WithRetryDelay

func WithRetryDelay(i string) Option

WithRetryDelay returns an RetryDelay functional option

func WithSysAuthDomain

func WithSysAuthDomain(d string) Option

WithSysAuthDomain returns a SysAuthDomain functional option

type Provider

type Provider func(AthenzEnv, string) authcore.Verifier

Provider represent the public key provider to retrive the public key.

type PublicKey

type PublicKey struct {
	ID  string `json:"id"`
	Key string `json:"key"`
}

PublicKey represent the public key ID and the key from Athenz

type SysAuthConfig

type SysAuthConfig struct {
	Modified   string       `json:"modified"`
	Name       string       `json:"name"`
	PublicKeys []*PublicKey `json:"publicKeys"`
}

SysAuthConfig represent the system authority config data structure

Jump to

Keyboard shortcuts

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