Documentation
¶
Index ¶
- func NewSecretValueBackend(db drkey.SecretValueDB, masterKey []byte, keyDuration time.Duration) *secretValueBackend
- type Fetcher
- type Level1ARC
- type Level1Engine
- type Level1PrefetchInfo
- type Level1PrefetchListKeeper
- type Prefetcher
- type ServiceEngine
- func (s *ServiceEngine) CreateStorageCleaners() []*cleaner.Cleaner
- func (s *ServiceEngine) DeriveASHost(ctx context.Context, meta drkey.ASHostMeta) (drkey.ASHostKey, error)
- func (s *ServiceEngine) DeriveHostAS(ctx context.Context, meta drkey.HostASMeta) (drkey.HostASKey, error)
- func (s *ServiceEngine) DeriveHostHost(ctx context.Context, meta drkey.HostHostMeta) (drkey.HostHostKey, error)
- func (s *ServiceEngine) DeriveLevel1(ctx context.Context, meta drkey.Level1Meta) (drkey.Level1Key, error)
- func (s *ServiceEngine) GetLevel1Key(ctx context.Context, meta drkey.Level1Meta) (drkey.Level1Key, error)
- func (s *ServiceEngine) GetLevel1PrefetchInfo() []Level1PrefetchInfo
- func (s *ServiceEngine) GetSecretValue(ctx context.Context, meta drkey.SecretValueMeta) (drkey.SecretValue, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSecretValueBackend ¶
func NewSecretValueBackend( db drkey.SecretValueDB, masterKey []byte, keyDuration time.Duration, ) *secretValueBackend
Types ¶
type Fetcher ¶
type Fetcher interface {
Level1(ctx context.Context, meta drkey.Level1Meta) (drkey.Level1Key, error)
}
Fetcher obtains a Level1 DRKey from a remote CS.
type Level1ARC ¶
type Level1ARC struct {
// contains filtered or unexported fields
}
Level1ARC maintains an Adaptive Replacement Cache, storing the necessary metadata to prefetch Level1 keys.
func NewLevel1ARC ¶
NewLevel1ARC returns a Level1ARC cache of a given size.
func (*Level1ARC) Info ¶
func (c *Level1ARC) Info() []Level1PrefetchInfo
Info returns the list of AS currently in cache.
func (*Level1ARC) Update ¶
func (c *Level1ARC) Update(keyPair Level1PrefetchInfo)
Update is intended to merely update the frequency of a given Level1Key in the ARC cache.
type Level1Engine ¶
type Level1Engine interface {
GetLevel1Key(ctx context.Context, meta drkey.Level1Meta) (drkey.Level1Key, error)
GetLevel1PrefetchInfo() []Level1PrefetchInfo
}
type Level1PrefetchInfo ¶
Level1PrefetchInfo contains the information to prefetch level1 keys from remote CSes.
type Level1PrefetchListKeeper ¶
type Level1PrefetchListKeeper interface {
// Update updates the keys in Level1Cache based on the Level1Key metadata.
Update(key Level1PrefetchInfo)
// GetLevel1InfoArray retrieves an array whose members contains information regarding
// level1 keys to prefetch.
Info() []Level1PrefetchInfo
}
Level1PrefetchListKeeper maintains a list for those level1 keys that are recently/frequently used.
type Prefetcher ¶
type Prefetcher struct {
LocalIA addr.IA
Engine Level1Engine
// XXX(JordiSubira): At the moment we assume "global" KeyDuration, i.e.
// every AS involved uses the same EpochDuration. This will be improve
// further in the future, so that the prefetcher get keys in advance
// based on the epoch established by the AS which derived the first
// level key.
KeyDuration time.Duration
}
Prefetcher is in charge of getting the level 1 keys before they expire.
func (*Prefetcher) Run ¶
func (f *Prefetcher) Run(ctx context.Context)
Run requests the level 1 keys to other CSs.
type ServiceEngine ¶
type ServiceEngine struct {
SecretBackend *secretValueBackend
LocalIA addr.IA
DB drkey.Level1DB
Fetcher Fetcher
PrefetchKeeper Level1PrefetchListKeeper
}
ServiceEngine maintains and provides secret values, level1 keys and prefetching information.
func (*ServiceEngine) CreateStorageCleaners ¶
func (s *ServiceEngine) CreateStorageCleaners() []*cleaner.Cleaner
CreateStorageCleaners creates Cleaner tasks that remove SecretValue and Level1 keys respectively.
func (*ServiceEngine) DeriveASHost ¶
func (s *ServiceEngine) DeriveASHost( ctx context.Context, meta drkey.ASHostMeta, ) (drkey.ASHostKey, error)
DeriveASHost returns an AS-Host key based on the presented information.
func (*ServiceEngine) DeriveHostAS ¶
func (s *ServiceEngine) DeriveHostAS( ctx context.Context, meta drkey.HostASMeta, ) (drkey.HostASKey, error)
DeriveHostAS returns an Host-AS key based on the presented information.
func (*ServiceEngine) DeriveHostHost ¶
func (s *ServiceEngine) DeriveHostHost( ctx context.Context, meta drkey.HostHostMeta, ) (drkey.HostHostKey, error)
DeriveHostHost returns an Host-Host key based on the presented information.
func (*ServiceEngine) DeriveLevel1 ¶
func (s *ServiceEngine) DeriveLevel1( ctx context.Context, meta drkey.Level1Meta, ) (drkey.Level1Key, error)
DeriveLevel1 returns a Level1 key based on the presented information.
func (*ServiceEngine) GetLevel1Key ¶
func (s *ServiceEngine) GetLevel1Key( ctx context.Context, meta drkey.Level1Meta, ) (drkey.Level1Key, error)
GetLevel1Key returns the level 1 drkey from the local DB or, if not found, by asking any CS in the source AS of the key. It also updates the Level1Cache, if needed.
func (*ServiceEngine) GetLevel1PrefetchInfo ¶
func (s *ServiceEngine) GetLevel1PrefetchInfo() []Level1PrefetchInfo
GetLevel1PrefetchInfo returns a list of ASes currently in the cache.
func (*ServiceEngine) GetSecretValue ¶
func (s *ServiceEngine) GetSecretValue( ctx context.Context, meta drkey.SecretValueMeta, ) (drkey.SecretValue, error)
GetSecretValue returns a valid secret value for the provided metadata. It tries to retrieve the secret value from persistence, otherwise it creates a new one and stores it away.