Documentation
¶
Index ¶
- Variables
- type AclList
- type AclRecord
- type AclRecordBuilder
- type AclState
- func (st *AclState) CurrentReadKey() (crypto.SymKey, error)
- func (st *AclState) CurrentReadKeyId() string
- func (st *AclState) HasPermission(identity crypto.PubKey, permission aclrecordproto.AclUserPermissions) bool
- func (st *AclState) Invite(acceptPubKey []byte) (invite *aclrecordproto.AclUserInvite, err error)
- func (st *AclState) LastRecordId() string
- func (st *AclState) StateAtRecord(id string, pubKey crypto.PubKey) (AclUserState, error)
- func (st *AclState) UserReadKeys() map[string]crypto.SymKey
- func (st *AclState) UserStates() map[string]AclUserState
- type AclUserState
- type IterFunc
- type RWLocker
- type RootContent
- type UserPermissionPair
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoSuchUser = errors.New("no such user") ErrFailedToDecrypt = errors.New("failed to decrypt key") ErrUserRemoved = errors.New("user was removed from the document") ErrDocumentForbidden = errors.New("your user was forbidden access to the document") ErrUserAlreadyExists = errors.New("user already exists") ErrNoSuchRecord = errors.New("no such record") ErrNoSuchInvite = errors.New("no such invite") ErrOldInvite = errors.New("invite is too old") ErrInsufficientPermissions = errors.New("insufficient permissions") ErrNoReadKey = errors.New("acl state doesn't have a read key") ErrInvalidSignature = errors.New("signature is invalid") ErrIncorrectRoot = errors.New("incorrect root") ErrIncorrectRecordSequence = errors.New("incorrect prev id of a record") )
View Source
var ErrIncorrectCID = errors.New("incorrect CID")
Functions ¶
This section is empty.
Types ¶
type AclList ¶
type AclList interface {
RWLocker
Id() string
Root() *aclrecordproto.RawAclRecordWithId
Records() []*AclRecord
AclState() *AclState
IsAfter(first string, second string) (bool, error)
Head() *AclRecord
Get(id string) (*AclRecord, error)
Iterate(iterFunc IterFunc)
IterateFrom(startId string, iterFunc IterFunc)
KeyStorage() crypto.KeyStorage
AddRawRecord(rawRec *aclrecordproto.RawAclRecordWithId) (added bool, err error)
Close() (err error)
}
func BuildAclList ¶
func BuildAclList(storage liststorage.ListStorage) (AclList, error)
func BuildAclListWithIdentity ¶
func BuildAclListWithIdentity(acc *accountdata.AccountKeys, storage liststorage.ListStorage) (AclList, error)
func NewTestDerivedAcl ¶
func NewTestDerivedAcl(spaceId string, keys *accountdata.AccountKeys) (AclList, error)
type AclRecordBuilder ¶
type AclRecordBuilder interface {
Unmarshall(rawIdRecord *aclrecordproto.RawAclRecordWithId) (rec *AclRecord, err error)
BuildRoot(content RootContent) (rec *aclrecordproto.RawAclRecordWithId, err error)
}
func NewAclRecordBuilder ¶
func NewAclRecordBuilder(id string, keyStorage crypto.KeyStorage) AclRecordBuilder
type AclState ¶
type AclState struct {
// contains filtered or unexported fields
}
func (*AclState) CurrentReadKeyId ¶
func (*AclState) HasPermission ¶
func (st *AclState) HasPermission(identity crypto.PubKey, permission aclrecordproto.AclUserPermissions) bool
func (*AclState) Invite ¶
func (st *AclState) Invite(acceptPubKey []byte) (invite *aclrecordproto.AclUserInvite, err error)
func (*AclState) LastRecordId ¶
func (*AclState) StateAtRecord ¶
func (*AclState) UserStates ¶
func (st *AclState) UserStates() map[string]AclUserState
type AclUserState ¶
type AclUserState struct {
PubKey crypto.PubKey
Permissions aclrecordproto.AclUserPermissions
}
type RootContent ¶
type UserPermissionPair ¶
type UserPermissionPair struct {
Identity crypto.PubKey
Permission aclrecordproto.AclUserPermissions
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.