access2

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	SatelliteAddress string
	APIKey           *macaroon.APIKey
	EncAccess        *EncryptionAccess
}

An Access Grant contains everything to access a project and specific buckets. It includes a potentially-restricted API Key, a potentially-restricted set of encryption information, and information about the Satellite responsible for the project's metadata.

func ParseAccess

func ParseAccess(access string) (*Access, error)

ParseAccess parses a serialized access grant string.

This should be the main way to instantiate an access grant for opening a project. See the note on RequestAccessWithPassphrase.

func (*Access) Serialize

func (access *Access) Serialize() (string, error)

Serialize serializes an access grant such that it can be used later with ParseAccess or other tools.

type EncryptionAccess

type EncryptionAccess struct {
	Store *encryption.Store
}

EncryptionAccess represents an encryption access context. It holds information about how various buckets and objects should be encrypted and decrypted.

func NewEncryptionAccess

func NewEncryptionAccess() *EncryptionAccess

NewEncryptionAccess creates an encryption access context.

func NewEncryptionAccessWithDefaultKey

func NewEncryptionAccessWithDefaultKey(defaultKey *storj.Key) *EncryptionAccess

NewEncryptionAccessWithDefaultKey creates an encryption access context with a default key set. Use (*Project).SaltedKeyFromPassphrase to generate a default key.

func (*EncryptionAccess) LimitTo added in v1.4.6

func (s *EncryptionAccess) LimitTo(apiKey *macaroon.APIKey)

LimitTo limits the data in the encryption access only to the paths that would be allowed by the api key. Any errors that happen due to the consistency of the api key cause no keys to be stored.

func (*EncryptionAccess) SetDefaultKey

func (s *EncryptionAccess) SetDefaultKey(defaultKey *storj.Key)

SetDefaultKey sets the default key for the encryption access context. Use (*Project).SaltedKeyFromPassphrase to generate a default key.

func (*EncryptionAccess) SetDefaultPathCipher

func (s *EncryptionAccess) SetDefaultPathCipher(defaultPathCipher storj.CipherSuite)

SetDefaultPathCipher sets which cipher suite to use by default.

Jump to

Keyboard shortcuts

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