storage

package
v0.0.0-...-115fbbe Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const EMPTY_QUEUE string = "redis: nil"
View Source
const NO_EXPIRATION time.Duration = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type CertDatabase

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

func NewCertDatabase

func NewCertDatabase(aExtCache RemoteCache) (CertDatabase, error)

func (*CertDatabase) GetCTLogsFromCache

func (db *CertDatabase) GetCTLogsFromCache() ([]types.CTLogState, error)

func (*CertDatabase) GetIssuerAndDatesFromCache

func (db *CertDatabase) GetIssuerAndDatesFromCache() ([]types.IssuerDate, error)

func (*CertDatabase) GetIssuerMetadata

func (db *CertDatabase) GetIssuerMetadata(aIssuer types.Issuer) *IssuerMetadata

func (*CertDatabase) GetKnownCertificates

func (db *CertDatabase) GetKnownCertificates(aExpDate types.ExpDate,
	aIssuer types.Issuer) *KnownCertificates

func (*CertDatabase) GetLogState

func (db *CertDatabase) GetLogState(aUrl *url.URL) (*types.CTLogState, error)

func (*CertDatabase) Migrate

func (db *CertDatabase) Migrate(aLogData *types.CTLogMetadata) error

func (*CertDatabase) SaveLogState

func (db *CertDatabase) SaveLogState(aLogObj *types.CTLogState) error

func (*CertDatabase) Store

func (db *CertDatabase) Store(aCert *x509.Certificate, aIssuer *x509.Certificate,
	aLogURL string, aEntryId int64) error

type IssuerMetadata

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

func NewIssuerMetadata

func NewIssuerMetadata(aIssuer types.Issuer, aCache RemoteCache) *IssuerMetadata

func (*IssuerMetadata) Accumulate

func (im *IssuerMetadata) Accumulate(aCert *x509.Certificate) error

Store CRL and Issuer records

func (*IssuerMetadata) CRLs

func (im *IssuerMetadata) CRLs() []string

func (*IssuerMetadata) Issuers

func (im *IssuerMetadata) Issuers() []string

func (*IssuerMetadata) ShouldStoreMetadata

func (im *IssuerMetadata) ShouldStoreMetadata(aCert *x509.Certificate) bool

Check if the certificate contains any novel CRLs or issuer DNs

type KnownCertificates

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

func NewKnownCertificates

func NewKnownCertificates(aExpDate types.ExpDate, aIssuer types.Issuer, aCache RemoteCache) *KnownCertificates

func (*KnownCertificates) Count

func (kc *KnownCertificates) Count() int64

func (*KnownCertificates) Known

func (kc *KnownCertificates) Known() []types.Serial

func (*KnownCertificates) WasUnknown

func (kc *KnownCertificates) WasUnknown(aSerial types.Serial) (bool, error)

Returns true if this serial was unknown. Subsequent calls with the same serial will return false, as it will be known then.

type LocalDiskBackend

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

func (*LocalDiskBackend) StoreKnownCertificateList

func (db *LocalDiskBackend) StoreKnownCertificateList(ctx context.Context, issuer types.Issuer,
	serials []types.Serial) error

type MockBackend

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

func NewMockBackend

func NewMockBackend() *MockBackend

func (*MockBackend) StoreKnownCertificateList

func (db *MockBackend) StoreKnownCertificateList(_ context.Context, issuer types.Issuer,
	serials []types.Serial) error

type MockRemoteCache

type MockRemoteCache struct {
	Data        map[string][]string
	Expirations map[string]time.Time
	Duplicate   int
}

func NewMockRemoteCache

func NewMockRemoteCache() *MockRemoteCache

func (*MockRemoteCache) BlockingPopCopy

func (ec *MockRemoteCache) BlockingPopCopy(key string, dest string,
	timeout time.Duration) (string, error)

func (*MockRemoteCache) CleanupExpiry

func (ec *MockRemoteCache) CleanupExpiry()

func (*MockRemoteCache) Exists

func (ec *MockRemoteCache) Exists(key string) (bool, error)

func (*MockRemoteCache) ExpireAt

func (ec *MockRemoteCache) ExpireAt(key string, expTime time.Time) error

func (*MockRemoteCache) ExpireIn

func (ec *MockRemoteCache) ExpireIn(key string, dur time.Duration) error

func (*MockRemoteCache) KeysToChan

func (ec *MockRemoteCache) KeysToChan(pattern string, c chan<- string) error

func (*MockRemoteCache) ListRemove

func (ec *MockRemoteCache) ListRemove(key string, value string) error

func (*MockRemoteCache) LoadAllLogStates

func (ec *MockRemoteCache) LoadAllLogStates() ([]types.CTLogState, error)

func (*MockRemoteCache) LoadLogState

func (ec *MockRemoteCache) LoadLogState(shortUrl string) (*types.CTLogState, error)

func (*MockRemoteCache) Migrate

func (ec *MockRemoteCache) Migrate(logData *types.CTLogMetadata) error

func (*MockRemoteCache) Pop

func (ec *MockRemoteCache) Pop(key string) (string, error)

func (*MockRemoteCache) Queue

func (ec *MockRemoteCache) Queue(key string, identifier string) (int64, error)

func (*MockRemoteCache) QueueLength

func (ec *MockRemoteCache) QueueLength(key string) (int64, error)

func (*MockRemoteCache) SetCardinality

func (ec *MockRemoteCache) SetCardinality(key string) (int, error)

func (*MockRemoteCache) SetContains

func (ec *MockRemoteCache) SetContains(key string, entry string) (bool, error)

func (*MockRemoteCache) SetInsert

func (ec *MockRemoteCache) SetInsert(key string, entry string) (bool, error)

func (*MockRemoteCache) SetList

func (ec *MockRemoteCache) SetList(key string) ([]string, error)

func (*MockRemoteCache) SetRemove

func (ec *MockRemoteCache) SetRemove(key string, entry string) (bool, error)

func (*MockRemoteCache) SetToChan

func (ec *MockRemoteCache) SetToChan(key string, c chan<- string) error

func (*MockRemoteCache) StoreLogState

func (ec *MockRemoteCache) StoreLogState(log *types.CTLogState) error

func (*MockRemoteCache) TrySet

func (ec *MockRemoteCache) TrySet(key string, v string, life time.Duration) (string, error)

type NoopBackend

type NoopBackend struct {
}

func NewNoopBackend

func NewNoopBackend() *NoopBackend

func (*NoopBackend) StoreKnownCertificateList

func (db *NoopBackend) StoreKnownCertificateList(_ context.Context, _ types.Issuer,
	_ []types.Serial) error

type RedisCache

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

func NewRedisCache

func NewRedisCache(addr string, cacheTimeout time.Duration) (*RedisCache, error)

func (*RedisCache) BlockingPopCopy

func (rc *RedisCache) BlockingPopCopy(key string, dest string,
	timeout time.Duration) (string, error)

func (*RedisCache) Exists

func (rc *RedisCache) Exists(key string) (bool, error)

func (*RedisCache) ExpireAt

func (rc *RedisCache) ExpireAt(key string, aExpTime time.Time) error

func (*RedisCache) ExpireIn

func (rc *RedisCache) ExpireIn(key string, aDuration time.Duration) error

func (*RedisCache) KeysToChan

func (rc *RedisCache) KeysToChan(pattern string, c chan<- string) error

func (*RedisCache) ListRemove

func (rc *RedisCache) ListRemove(key string, value string) error

func (*RedisCache) LoadAllLogStates

func (ec *RedisCache) LoadAllLogStates() ([]types.CTLogState, error)

func (*RedisCache) LoadLogState

func (ec *RedisCache) LoadLogState(shortUrl string) (*types.CTLogState, error)

func (*RedisCache) MemoryPolicyCorrect

func (rc *RedisCache) MemoryPolicyCorrect() error

func (*RedisCache) Migrate

func (ec *RedisCache) Migrate(logData *types.CTLogMetadata) error

func (*RedisCache) Pop

func (rc *RedisCache) Pop(key string) (string, error)

func (*RedisCache) Queue

func (rc *RedisCache) Queue(key string, identifier string) (int64, error)

func (*RedisCache) QueueLength

func (rc *RedisCache) QueueLength(key string) (int64, error)

func (*RedisCache) SetCardinality

func (rc *RedisCache) SetCardinality(key string) (int, error)

func (*RedisCache) SetContains

func (rc *RedisCache) SetContains(key string, entry string) (bool, error)

func (*RedisCache) SetInsert

func (rc *RedisCache) SetInsert(key string, entry string) (bool, error)

func (*RedisCache) SetList

func (rc *RedisCache) SetList(key string) ([]string, error)

func (*RedisCache) SetRemove

func (rc *RedisCache) SetRemove(key string, entry string) (bool, error)

func (*RedisCache) SetToChan

func (rc *RedisCache) SetToChan(key string, c chan<- string) error

func (*RedisCache) StoreLogState

func (ec *RedisCache) StoreLogState(log *types.CTLogState) error

func (*RedisCache) TrySet

func (rc *RedisCache) TrySet(k string, v string, life time.Duration) (string, error)

type RemoteCache

type RemoteCache interface {
	Exists(key string) (bool, error)
	SetInsert(key string, aEntry string) (bool, error)
	SetRemove(key string, entry string) (bool, error)
	SetContains(key string, aEntry string) (bool, error)
	SetList(key string) ([]string, error)
	SetToChan(key string, c chan<- string) error
	SetCardinality(key string) (int, error)
	ExpireAt(key string, aExpTime time.Time) error
	ExpireIn(key string, aDur time.Duration) error
	Queue(key string, identifier string) (int64, error)
	Pop(key string) (string, error)
	QueueLength(key string) (int64, error)
	BlockingPopCopy(key string, dest string, timeout time.Duration) (string, error)
	ListRemove(key string, value string) error
	TrySet(k string, v string, life time.Duration) (string, error)
	KeysToChan(pattern string, c chan<- string) error
	StoreLogState(aLogObj *types.CTLogState) error
	LoadLogState(aLogUrl string) (*types.CTLogState, error)
	LoadAllLogStates() ([]types.CTLogState, error)
	Migrate(logData *types.CTLogMetadata) error
}

type StorageBackend

type StorageBackend interface {
	StoreKnownCertificateList(ctx context.Context, issuer types.Issuer,
		serials []types.Serial) error
}

func NewLocalDiskBackend

func NewLocalDiskBackend(perms os.FileMode, aPath string) StorageBackend

Jump to

Keyboard shortcuts

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