Documentation ¶
Overview ¶
accesscontroller is a package handling permissions for OrbitDB stores
Index ¶
- func CreateManifest(ctx context.Context, ipfs coreapi.CoreAPI, controllerType string, ...) (cid.Cid, error)
- func WithLogger(logger *zap.Logger) func(ac Interface)
- type CanAppendAdditionalContext
- type CreateAccessControllerOptions
- func (m *CreateAccessControllerOptions) GetAccess(role string) []string
- func (m *CreateAccessControllerOptions) GetAddress() cid.Cid
- func (m *CreateAccessControllerOptions) GetAllAccess() map[string][]string
- func (m *CreateAccessControllerOptions) GetName() string
- func (m *CreateAccessControllerOptions) GetSkipManifest() bool
- func (m *CreateAccessControllerOptions) GetType() string
- func (m *CreateAccessControllerOptions) SetAccess(role string, allowed []string)
- func (m *CreateAccessControllerOptions) SetAddress(c cid.Cid)
- func (m *CreateAccessControllerOptions) SetName(name string)
- func (m *CreateAccessControllerOptions) SetType(t string)
- type Interface
- type LogEntry
- type Manifest
- type ManifestParams
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateManifest ¶
func CreateManifest(ctx context.Context, ipfs coreapi.CoreAPI, controllerType string, params ManifestParams) (cid.Cid, error)
CreateManifest Creates a new manifest and returns its CID
func WithLogger ¶
Types ¶
type CanAppendAdditionalContext ¶
type CanAppendAdditionalContext = accesscontroller.CanAppendAdditionalContext
type CreateAccessControllerOptions ¶
type CreateAccessControllerOptions struct { SkipManifest bool Address cid.Cid Type string Name string Access map[string][]string // contains filtered or unexported fields }
CreateAccessControllerOptions Options used to create an Access Controller
func CloneManifestParams ¶
func CloneManifestParams(m ManifestParams) *CreateAccessControllerOptions
func (*CreateAccessControllerOptions) GetAccess ¶
func (m *CreateAccessControllerOptions) GetAccess(role string) []string
func (*CreateAccessControllerOptions) GetAddress ¶
func (m *CreateAccessControllerOptions) GetAddress() cid.Cid
func (*CreateAccessControllerOptions) GetAllAccess ¶
func (m *CreateAccessControllerOptions) GetAllAccess() map[string][]string
func (*CreateAccessControllerOptions) GetName ¶
func (m *CreateAccessControllerOptions) GetName() string
func (*CreateAccessControllerOptions) GetSkipManifest ¶
func (m *CreateAccessControllerOptions) GetSkipManifest() bool
func (*CreateAccessControllerOptions) GetType ¶
func (m *CreateAccessControllerOptions) GetType() string
func (*CreateAccessControllerOptions) SetAccess ¶
func (m *CreateAccessControllerOptions) SetAccess(role string, allowed []string)
func (*CreateAccessControllerOptions) SetAddress ¶
func (m *CreateAccessControllerOptions) SetAddress(c cid.Cid)
func (*CreateAccessControllerOptions) SetName ¶
func (m *CreateAccessControllerOptions) SetName(name string)
func (*CreateAccessControllerOptions) SetType ¶
func (m *CreateAccessControllerOptions) SetType(t string)
type Interface ¶
type Interface interface { accesscontroller.Interface // Type Returns the type of the store as a string Type() string // GetAuthorizedByRole Returns the list of keys authorized for a given role GetAuthorizedByRole(role string) ([]string, error) // Grant Allows a new key for a given role Grant(ctx context.Context, capability string, keyID string) error // Revoke Removes the permission of a key to perform an action Revoke(ctx context.Context, capability string, keyID string) error // Load Fetches the configuration of the access controller using the given // address Load(ctx context.Context, address string) error // Save Persists the store configuration (its manifest) Save(ctx context.Context) (ManifestParams, error) // Close Closes the store Close() error SetLogger(logger *zap.Logger) Logger() *zap.Logger }
Interface The interface for OrbitDB Access Controllers
type LogEntry ¶
type LogEntry = iface.IPFSLogEntry
type Manifest ¶
type Manifest struct { Type string Params *CreateAccessControllerOptions }
Manifest An access controller manifest
func ResolveManifest ¶
func ResolveManifest(ctx context.Context, ipfs coreapi.CoreAPI, manifestAddress string, params ManifestParams) (*Manifest, error)
ResolveManifest Retrieves a manifest from its address
type ManifestParams ¶
type ManifestParams interface { GetSkipManifest() bool GetAddress() cid.Cid SetAddress(cid.Cid) GetType() string SetType(string) GetName() string SetName(string) SetAccess(string, []string) GetAccess(string) []string GetAllAccess() map[string][]string }
ManifestParams List of getters for a manifest parameters
func NewEmptyManifestParams ¶
func NewEmptyManifestParams() ManifestParams
func NewManifestParams ¶
func NewManifestParams(address cid.Cid, skipManifest bool, manifestType string) ManifestParams
Create a new manifest parameters instance
func NewSimpleManifestParams ¶
func NewSimpleManifestParams(manifestType string, access map[string][]string) ManifestParams
Directories ¶
Path | Synopsis |
---|---|
ipfs is an access controller
|
ipfs is an access controller |
orbitdb is an access controller for OrbitDB stores
|
orbitdb is an access controller for OrbitDB stores |
simple is an access controller without any persistence
|
simple is an access controller without any persistence |
utils is a package containing tools related to access controllers
|
utils is a package containing tools related to access controllers |
Click to show internal directories.
Click to hide internal directories.