consolewasm

package
v1.78.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: AGPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveRootKey added in v1.54.1

func DeriveRootKey(encryptionPassphrase, base64EncodedSalt string) (*storj.Key, error)

DeriveRootKey derives the root key portion of the access grant.

func GenAccessGrant

func GenAccessGrant(satelliteNodeURL, apiKey, encryptionPassphrase, base64EncodedSalt string) (string, error)

GenAccessGrant creates a new access grant and returns it serialized form.

func RestrictGrant added in v1.26.2

func RestrictGrant(accessGrant string, paths []string, permission Permission) (string, error)

RestrictGrant restricts an access grant with the permissions and paths and returns a new access grant.

func SetPermission

func SetPermission(key string, buckets []string, permission Permission) (*macaroon.APIKey, error)

SetPermission restricts the api key with the permissions and returns an api key with restricted permissions.

Types

type Permission

type Permission struct {
	// AllowDownload gives permission to download the object's content. It
	// allows getting object metadata, but it does not allow listing buckets.
	AllowDownload bool
	// AllowUpload gives permission to create buckets and upload new objects.
	// It does not allow overwriting existing objects unless AllowDelete is
	// granted too.
	AllowUpload bool
	// AllowList gives permission to list buckets. It allows getting object
	// metadata, but it does not allow downloading the object's content.
	AllowList bool
	// AllowDelete gives permission to delete buckets and objects. Unless
	// either AllowDownload or AllowList is granted too, no object metadata and
	// no error info will be returned for deleted objects.
	AllowDelete bool
	// NotBefore restricts when the resulting access grant is valid for.
	// If set, the resulting access grant will not work if the Satellite
	// believes the time is before NotBefore.
	// If set, this value should always be before NotAfter.
	NotBefore time.Time
	// NotAfter restricts when the resulting access grant is valid for.
	// If set, the resulting access grant will not work if the Satellite
	// believes the time is after NotAfter.
	// If set, this value should always be after NotBefore.
	NotAfter time.Time
}

Permission defines what actions can be used to share.

This struct has been taken from storj.io/uplink and duplicated to avoid pulling in that dependency.

Jump to

Keyboard shortcuts

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