Documentation ¶
Index ¶
- Constants
- func ReadStream(receiver func() (interface{}, error)) (interface{}, error)
- func ReceiveAllAddresses(cli interface{ ... }) ([]*api.Address, error)
- func ReceiveAllPlaintexts(cli interface{ ... }) (*api.Plaintext, error)
- func ReceiveAllReferences(cli interface{ ... }) (reference.Refs, error)
- func SendPlaintext(data []byte, chunkSize int, srv PlaintextSender, version int32) error
- func StreamFileFrom(reader io.Reader, chunkSize int, sender func(chunk []byte) error) error
- func StreamFileTo(writer io.Writer, receiver func() ([]byte, error)) error
- type EncryptionService
- type GrantService
- type Hoard
- func (hrd *Hoard) Decrypt(ref *reference.Ref, encryptedData []byte) ([]byte, error)
- func (hrd *Hoard) Delete(address []byte) error
- func (hrd *Hoard) Encrypt(data, salt []byte) (*reference.Ref, []byte, error)
- func (hrd *Hoard) Get(ref *reference.Ref) ([]byte, error)
- func (hrd *Hoard) Name() string
- func (hrd *Hoard) Put(data, salt []byte) (*reference.Ref, error)
- func (hrd *Hoard) Seal(refs reference.Refs, spec *grant.Spec) (*grant.Grant, error)
- func (hrd *Hoard) Store() stores.ContentAddressedStore
- func (hrd *Hoard) Unseal(grt *grant.Grant) (reference.Refs, error)
- type ObjectService
- type PlaintextSender
- type Service
- func (service *Service) Decrypt(srv api.Encryption_DecryptServer) error
- func (service *Service) Delete(ctx context.Context, address *api.Address) (*api.Address, error)
- func (service *Service) Encrypt(srv api.Encryption_EncryptServer) error
- func (service *Service) Get(srv api.Cleartext_GetServer) error
- func (service *Service) Pull(srv api.Storage_PullServer) error
- func (service *Service) Push(srv api.Storage_PushServer) error
- func (service *Service) Put(srv api.Cleartext_PutServer) error
- func (service *Service) PutSeal(srv api.Grant_PutSealServer) error
- func (service *Service) Reseal(ctx context.Context, arg *api.GrantAndGrantSpec) (*grant.Grant, error)
- func (service *Service) Seal(srv api.Grant_SealServer) error
- func (service *Service) Stat(ctx context.Context, address *api.Address) (*stores.StatInfo, error)
- func (service *Service) Unseal(grt *grant.Grant, srv api.Grant_UnsealServer) error
- func (service *Service) UnsealDelete(grt *grant.Grant, srv api.Grant_UnsealDeleteServer) error
- func (service *Service) UnsealGet(grt *grant.Grant, srv api.Grant_UnsealGetServer) error
Constants ¶
const MaxChunkSize = 1 << 20
MaxChunkSize = 1MiB
Variables ¶
This section is empty.
Functions ¶
func ReadStream ¶
ReadStream returns an interface when it is non-nil
func ReceiveAllAddresses ¶
func ReceiveAllPlaintexts ¶
func ReceiveAllReferences ¶
func SendPlaintext ¶
func SendPlaintext(data []byte, chunkSize int, srv PlaintextSender, version int32) error
SendPlaintext gets the plaintext for a given reference and sends it to the client
func StreamFileFrom ¶
StreamFileFrom provides a convenience wrapper over an io.Reader
Types ¶
type EncryptionService ¶
type GrantService ¶
type Hoard ¶
type Hoard struct {
// contains filtered or unexported fields
}
This is our top level API object providing library acting as a deterministic encrypted store and a grant issuer. It can be consumed as a Go library or as a GRPC service through grpcService which just plumbs this object into the hoard.proto interface.
func NewHoard ¶
func NewHoard(store stores.NamedStore, secrets config.SecretsManager, logger log.Logger) *Hoard
func (*Hoard) Store ¶
func (hrd *Hoard) Store() stores.ContentAddressedStore
type ObjectService ¶
type ObjectService interface { EncryptionService // Get encrypted data from underlying storage at address and decrypt it Get(ref *reference.Ref) (data []byte, err error) // Encrypt data and put it in underlying storage Put(data, salt []byte) (*reference.Ref, error) // Delete underlying data obtained by address Delete(address []byte) error // Get the underlying ContentAddressedStore Store() stores.ContentAddressedStore }
type PlaintextSender ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements the GRPC Hoard service. It should mostly be plumbing to a DeterministicEncryptedStore (for which hoard.hoard is the canonical example) and also to Grants.
func NewService ¶
func NewService(grantService GrantService, chunkSize int) *Service
func (*Service) Decrypt ¶
func (service *Service) Decrypt(srv api.Encryption_DecryptServer) error
Decrypt ciphertext and return plaintext
func (*Service) Encrypt ¶
func (service *Service) Encrypt(srv api.Encryption_EncryptServer) error
Encrypt data and return ciphertext
func (*Service) Get ¶
func (service *Service) Get(srv api.Cleartext_GetServer) error
Get decrypted data from the store
func (*Service) Pull ¶
func (service *Service) Pull(srv api.Storage_PullServer) error
Pull gets ciphertext directly from the store
func (*Service) Push ¶
func (service *Service) Push(srv api.Storage_PushServer) error
Push ciphertext directly to store
func (*Service) Put ¶
func (service *Service) Put(srv api.Cleartext_PutServer) error
Put encrypted data in the store
func (*Service) PutSeal ¶
func (service *Service) PutSeal(srv api.Grant_PutSealServer) error
PutSeal encrypts and seals plaintext
func (*Service) Reseal ¶
func (service *Service) Reseal(ctx context.Context, arg *api.GrantAndGrantSpec) (*grant.Grant, error)
Reseal changes how the references in a grant are stored
func (*Service) Seal ¶
func (service *Service) Seal(srv api.Grant_SealServer) error
Seal puts refs in a shareable grant
func (*Service) UnsealDelete ¶
UnsealDelete gets the references stored in a grant and deletes them
Directories ¶
Path | Synopsis |
---|---|
Contains core types and logic pertaining to Hoard's backend storage services - but not the implementations of those stores to avoid a large number of possibly unwanted dependencies
|
Contains core types and logic pertaining to Hoard's backend storage services - but not the implementations of those stores to avoid a large number of possibly unwanted dependencies |
test
|
|