certsubjectmapping

package
v0.0.0-...-a423d60 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CertSubjectMappingLoaderCorrelationID        = "cert-subject-mapping-loader-correlation-id"
	CertSubjectMappingInitialLoaderCorrelationID = "cert-subject-mapping-initial-loader-correlation-id"
	CertSubjectMappingRetryInterval              = 50 * time.Millisecond
)

Functions

func NewCertSubjectMappingCache

func NewCertSubjectMappingCache() *certSubjectMappingCache

NewCertSubjectMappingCache creates a new certificate subject mapping cache

Types

type Cache

type Cache interface {
	Get() []csm.SubjectConsumerTypeMapping
	Put(certSubjectMappings []csm.SubjectConsumerTypeMapping)
}

Cache is responsible for the read and write operation of the cert subject mapping in-memory storage

func StartCertSubjectMappingLoader

func StartCertSubjectMappingLoader(ctx context.Context, certSubjectMappingCfg Config, directorClient DirectorClient) (Cache, error)

type Config

type Config struct {
	ResyncInterval      time.Duration `envconfig:"APP_CERT_SUBJECT_MAPPING_RESYNC_INTERVAL"`
	EnvironmentMappings string        `envconfig:"default=[],APP_SUBJECT_CONSUMER_MAPPING_CONFIG"`
}

type DirectorClient

type DirectorClient interface {
	ListCertificateSubjectMappings(ctx context.Context, after string) (*schema.CertificateSubjectMappingPage, error)
}

DirectorClient is a GraphQL client used to communicate with the director component and the DB

type Loader

type Loader interface {
	Run(ctx context.Context, certSubjectMappingsFromEnv string)
	InitialiseCertSubjectMappings(ctx context.Context, certSubjectMappingsFromEnv string) error
}

Loader provide mechanism to load certificate subject mappings' data into in-memory storage

func NewCertSubjectMappingLoader

func NewCertSubjectMappingLoader(certSubjectMappingCache *certSubjectMappingCache, certSubjectMappingCfg Config, directorClient DirectorClient) Loader

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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