acl

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnauthorized is returned when a peer tries to access a file he
	// is not allowed to get.
	ErrUnauthorized = errors.New("peer not authorized for requested file")

	// ErrIncorrectHashSize is returned when using a hash that is not hashSize.
	ErrIncorrectHashSize = errors.Errorf("file hash should be %d bytes", hashSize)
)

Functions

This section is empty.

Types

type ACL

type ACL interface {

	// Authorize gives a list of peers access to a file hash.
	Authorize(context.Context, []peer.ID, []byte) error

	// IsAuthorized checks if a peer is authorized for a file hash.
	IsAuthorized(context.Context, peer.ID, []byte) (bool, error)
}

ACL handles permissions on the files in the storage.

func NewACL

func NewACL(db db.DB) ACL

NewACL returns a new ACL handler.

Jump to

Keyboard shortcuts

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