Documentation ¶
Index ¶
- func NewAddDirectGroup(c tree.RefContext) (tree.EntityHook, error)
- func NewAddEntityKey(c tree.RefContext) (tree.EntityHook, error)
- func NewAddEntityUM(c tree.RefContext) (tree.EntityHook, error)
- func NewAddGroupUM(c tree.RefContext) (tree.GroupHook, error)
- func NewCheckExpansionCycles(c tree.RefContext) (tree.GroupHook, error)
- func NewCheckExpansionTargets(c tree.RefContext) (tree.GroupHook, error)
- func NewCheckImmediateExpansions(c tree.RefContext) (tree.GroupHook, error)
- func NewCreateEntityIfMissing(c tree.RefContext) (tree.EntityHook, error)
- func NewDelDirectGroup(c tree.RefContext) (tree.EntityHook, error)
- func NewDelEntityKey(c tree.RefContext) (tree.EntityHook, error)
- func NewDelExactEntityUM(c tree.RefContext) (tree.EntityHook, error)
- func NewDelExactGroupUM(c tree.RefContext) (tree.GroupHook, error)
- func NewDelFuzzyEntityUM(c tree.RefContext) (tree.EntityHook, error)
- func NewDelFuzzyGroupUM(c tree.RefContext) (tree.GroupHook, error)
- func NewDestroyEntity(c tree.RefContext) (tree.EntityHook, error)
- func NewDestroyGroup(c tree.RefContext) (tree.GroupHook, error)
- func NewELMLock(c tree.RefContext) (tree.EntityHook, error)
- func NewELMUnlock(c tree.RefContext) (tree.EntityHook, error)
- func NewEnsureEntityMeta(c tree.RefContext) (tree.EntityHook, error)
- func NewFailOnExistingEntity(c tree.RefContext) (tree.EntityHook, error)
- func NewFailOnExistingGroup(c tree.RefContext) (tree.GroupHook, error)
- func NewLoadEntity(c tree.RefContext) (tree.EntityHook, error)
- func NewLoadGroup(c tree.RefContext) (tree.GroupHook, error)
- func NewMergeEntityMeta(c tree.RefContext) (tree.EntityHook, error)
- func NewMergeGroupMeta(c tree.RefContext) (tree.GroupHook, error)
- func NewPatchGroupExpansions(tree.RefContext) (tree.GroupHook, error)
- func NewRemoveEntityCapability(c tree.RefContext) (tree.EntityHook, error)
- func NewRemoveGroupCapability(c tree.RefContext) (tree.GroupHook, error)
- func NewSaveEntity(c tree.RefContext) (tree.EntityHook, error)
- func NewSaveGroup(c tree.RefContext) (tree.GroupHook, error)
- func NewSetEntityCapability(c tree.RefContext) (tree.EntityHook, error)
- func NewSetEntityID(c tree.RefContext) (tree.EntityHook, error)
- func NewSetEntityNumber(c tree.RefContext) (tree.EntityHook, error)
- func NewSetEntitySecret(c tree.RefContext) (tree.EntityHook, error)
- func NewSetGroupCapability(c tree.RefContext) (tree.GroupHook, error)
- func NewSetGroupDisplayName(c tree.RefContext) (tree.GroupHook, error)
- func NewSetGroupName(c tree.RefContext) (tree.GroupHook, error)
- func NewSetGroupNumber(c tree.RefContext) (tree.GroupHook, error)
- func NewSetManagingGroup(c tree.RefContext) (tree.GroupHook, error)
- func NewValidateEntitySecret(c tree.RefContext) (tree.EntityHook, error)
- func NewValidateEntityUnlocked(c tree.RefContext) (tree.EntityHook, error)
- type CheckExpansionCycles
- type CheckExpansionTargets
- type CheckImmediateExpansions
- type CreateEntityIfMissing
- type DestroyEntity
- type DestroyGroup
- type DirectGroupManager
- type EnsureEntityMeta
- type EntityLockManager
- type FailOnExistingEntity
- type FailOnExistingGroup
- type LoadEntity
- type LoadGroup
- type ManageEntityCapabilities
- type ManageEntityKeys
- type ManageEntityUM
- type ManageGroupCapabilities
- type ManageGroupUM
- type MergeEntityMeta
- type MergeGroupMeta
- type PatchGroupExpansions
- type SaveEntity
- type SaveGroup
- type SetEntityID
- type SetEntityNumber
- type SetEntitySecret
- type SetGroupDisplayName
- type SetGroupName
- type SetGroupNumber
- type SetManagingGroup
- type ValidateEntitySecret
- type ValidateEntityUnlocked
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAddDirectGroup ¶
func NewAddDirectGroup(c tree.RefContext) (tree.EntityHook, error)
NewAddDirectGroup returns a DirectGroupManager initialized in add mode.
func NewAddEntityKey ¶
func NewAddEntityKey(c tree.RefContext) (tree.EntityHook, error)
NewAddEntityKey returns a hook initialized for adding keys.
func NewAddEntityUM ¶
func NewAddEntityUM(c tree.RefContext) (tree.EntityHook, error)
NewAddEntityUM returns a configured hook in UPSERT mode.
func NewAddGroupUM ¶
func NewAddGroupUM(c tree.RefContext) (tree.GroupHook, error)
NewAddGroupUM returns a configured hook in UPSERT mode.
func NewCheckExpansionCycles ¶
func NewCheckExpansionCycles(c tree.RefContext) (tree.GroupHook, error)
NewCheckExpansionCycles returns a configured hook ready for use.
func NewCheckExpansionTargets ¶
func NewCheckExpansionTargets(c tree.RefContext) (tree.GroupHook, error)
NewCheckExpansionTargets returns a configured hook, ready for use.
func NewCheckImmediateExpansions ¶
func NewCheckImmediateExpansions(c tree.RefContext) (tree.GroupHook, error)
NewCheckImmediateExpansions returns a configured hook for use.
func NewCreateEntityIfMissing ¶
func NewCreateEntityIfMissing(c tree.RefContext) (tree.EntityHook, error)
NewCreateEntityIfMissing returns an initalized hook for use during tree initialization.
func NewDelDirectGroup ¶
func NewDelDirectGroup(c tree.RefContext) (tree.EntityHook, error)
NewDelDirectGroup returns a DirectGroupManager initialized in delete mode.
func NewDelEntityKey ¶
func NewDelEntityKey(c tree.RefContext) (tree.EntityHook, error)
NewDelEntityKey returns a hook initialized for removing keys.
func NewDelExactEntityUM ¶
func NewDelExactEntityUM(c tree.RefContext) (tree.EntityHook, error)
NewDelExactEntityUM returns a configured hook in CLEAREXACT mode.
func NewDelExactGroupUM ¶
func NewDelExactGroupUM(c tree.RefContext) (tree.GroupHook, error)
NewDelExactGroupUM returns a configured hook in CLEAREXACT mode.
func NewDelFuzzyEntityUM ¶
func NewDelFuzzyEntityUM(c tree.RefContext) (tree.EntityHook, error)
NewDelFuzzyEntityUM returns a configured hook in CLEARFUZZY mode.
func NewDelFuzzyGroupUM ¶
func NewDelFuzzyGroupUM(c tree.RefContext) (tree.GroupHook, error)
NewDelFuzzyGroupUM returns a configured hook in CLEARFUZZY mode.
func NewDestroyEntity ¶
func NewDestroyEntity(c tree.RefContext) (tree.EntityHook, error)
NewDestroyEntity returns an initialized DestroyEntity hook for use.
func NewDestroyGroup ¶
func NewDestroyGroup(c tree.RefContext) (tree.GroupHook, error)
NewDestroyGroup returns an initialized DestroyGroup hook for use.
func NewELMLock ¶
func NewELMLock(c tree.RefContext) (tree.EntityHook, error)
NewELMLock returns a configured hook in LOCK mode.
func NewELMUnlock ¶
func NewELMUnlock(c tree.RefContext) (tree.EntityHook, error)
NewELMUnlock returns a configured hook in UNLOCK mode.
func NewEnsureEntityMeta ¶
func NewEnsureEntityMeta(c tree.RefContext) (tree.EntityHook, error)
NewEnsureEntityMeta returns an initialized hook to the caller.
func NewFailOnExistingEntity ¶
func NewFailOnExistingEntity(c tree.RefContext) (tree.EntityHook, error)
NewFailOnExistingEntity will return an initialized hook ready for use.
func NewFailOnExistingGroup ¶
func NewFailOnExistingGroup(c tree.RefContext) (tree.GroupHook, error)
NewFailOnExistingGroup returns an initialized hook ready for use.
func NewLoadEntity ¶
func NewLoadEntity(c tree.RefContext) (tree.EntityHook, error)
NewLoadEntity returns an initialized hook ready for use.
func NewLoadGroup ¶
func NewLoadGroup(c tree.RefContext) (tree.GroupHook, error)
NewLoadGroup returns an initialized hook ready for use.
func NewMergeEntityMeta ¶
func NewMergeEntityMeta(c tree.RefContext) (tree.EntityHook, error)
NewMergeEntityMeta returns a MergeEntityMeta hook configured and ready for use.
func NewMergeGroupMeta ¶
func NewMergeGroupMeta(c tree.RefContext) (tree.GroupHook, error)
NewMergeGroupMeta returns a MergeGroupMeta hook configured and ready for use.
func NewPatchGroupExpansions ¶
func NewPatchGroupExpansions(tree.RefContext) (tree.GroupHook, error)
NewPatchGroupExpansions returns an initialized hook for use.
func NewRemoveEntityCapability ¶
func NewRemoveEntityCapability(c tree.RefContext) (tree.EntityHook, error)
NewRemoveEntityCapability returns a ManageEntityCapability hook pre-configured into the subtractive mode.s
func NewRemoveGroupCapability ¶
func NewRemoveGroupCapability(c tree.RefContext) (tree.GroupHook, error)
NewRemoveGroupCapability returns a ManageGroupCapability hook pre-configured into the subtractive mode.s
func NewSaveEntity ¶
func NewSaveEntity(c tree.RefContext) (tree.EntityHook, error)
NewSaveEntity returns an initialized hook ready for use.
func NewSaveGroup ¶
func NewSaveGroup(c tree.RefContext) (tree.GroupHook, error)
NewSaveGroup returns a configured hook for use.
func NewSetEntityCapability ¶
func NewSetEntityCapability(c tree.RefContext) (tree.EntityHook, error)
NewSetEntityCapability returns a ManageEntityCapability hook pre-configured into the additive mode.
func NewSetEntityID ¶
func NewSetEntityID(c tree.RefContext) (tree.EntityHook, error)
NewSetEntityID returns a SetEntityID hook initialized and ready for use.
func NewSetEntityNumber ¶
func NewSetEntityNumber(c tree.RefContext) (tree.EntityHook, error)
NewSetEntityNumber returns a SetEntityNumber hook ready for use.
func NewSetEntitySecret ¶
func NewSetEntitySecret(c tree.RefContext) (tree.EntityHook, error)
NewSetEntitySecret returns an initialized hook for use.
func NewSetGroupCapability ¶
func NewSetGroupCapability(c tree.RefContext) (tree.GroupHook, error)
NewSetGroupCapability returns a ManageGroupCapability hook pre-configured into the additive mode.
func NewSetGroupDisplayName ¶
func NewSetGroupDisplayName(c tree.RefContext) (tree.GroupHook, error)
NewSetGroupDisplayName returns an initialized hook ready for use.
func NewSetGroupName ¶
func NewSetGroupName(c tree.RefContext) (tree.GroupHook, error)
NewSetGroupName returns an initialized hook.
func NewSetGroupNumber ¶
func NewSetGroupNumber(c tree.RefContext) (tree.GroupHook, error)
NewSetGroupNumber returns a hook initialized and ready for use.
func NewSetManagingGroup ¶
func NewSetManagingGroup(c tree.RefContext) (tree.GroupHook, error)
NewSetManagingGroup returns a hook initialized for use.
func NewValidateEntitySecret ¶
func NewValidateEntitySecret(c tree.RefContext) (tree.EntityHook, error)
NewValidateEntitySecret returns an initialized hook ready for use.
func NewValidateEntityUnlocked ¶
func NewValidateEntityUnlocked(c tree.RefContext) (tree.EntityHook, error)
NewValidateEntityUnlocked returns an initialized hook.
Types ¶
type CheckExpansionCycles ¶
CheckExpansionCycles ensures that there is no path from the group g to expansions requested in the data group that could lead to a cycle in the inclusion graph.
func (*CheckExpansionCycles) Run ¶
func (cec *CheckExpansionCycles) Run(g, dg *pb.Group) error
Run will iterate through all expansions requested in dg and ensure that no cycles exist between the g and the requested include. If the mode for any expansion is DROP that expansion will be skipped without checking.
type CheckExpansionTargets ¶
CheckExpansionTargets verifies that all expansions requested target groups that exist, unless the expansion type is DROP.
func (*CheckExpansionTargets) Run ¶
func (cet *CheckExpansionTargets) Run(g, dg *pb.Group) error
Run iterates through all expansions on dg and ensures that if the expansion type isn't DROP that the group actually exists. This allows groups that have been deleted to effectively skip this check, since the only expansion that makes sense targeting a deleted group is to drop it.
type CheckImmediateExpansions ¶
CheckImmediateExpansions checks if a new expansion conflicts with an existing on attatched to the parent group. Expansions of type DROP are unchecked.
func (*CheckImmediateExpansions) Run ¶
func (cie *CheckImmediateExpansions) Run(g, dg *pb.Group) error
Run iterates over the expansions already on g, for each comparing to each expansion in dg. Excepting the case of an expansion type of DROP, which is unchecked, any matching expansion will result in an ErrExistingExpansion being returned.
type CreateEntityIfMissing ¶
CreateEntityIfMissing is an Entity hook that will ensure that e exists and is populated before returning. This hook is primarily used for bootstrap actions where an entity needs to either exist or be created and it isn't important which of these happens.
func (*CreateEntityIfMissing) Run ¶
func (c *CreateEntityIfMissing) Run(e, de *pb.Entity) error
Run will attempt to load the entity from an external source. If the load returns that the failure is due to an unknown entity, then one will be created. Any other load failure will result in an error being returned. Returned errors will be of a db.* type.
type DestroyEntity ¶
DestroyEntity removes an entity from the system.
type DestroyGroup ¶
DestroyGroup removes an entity from the system.
type DirectGroupManager ¶
DirectGroupManager implements a hook type that can add or remove the groups that an entity is directly a member of.
type EnsureEntityMeta ¶
EnsureEntityMeta has one function: to ensure that the metadata struct on an entity is not nil.
type EntityLockManager ¶
The EntityLockManager is a configurable hook that can either lock or unlock entities as needed.
type FailOnExistingEntity ¶
FailOnExistingEntity checks with the data store to see if an entity exists. If one does, then the hook will return an error that a duplicate ID already exists.
type FailOnExistingGroup ¶
FailOnExistingGroup is a hook that can be used to guard creation processes on groups.
type LoadEntity ¶
LoadEntity loads an entity from the database.
type ManageEntityCapabilities ¶
ManageEntityCapabilities is a configurable runtime hook that adds or removes capabilities as configured. Two convenience constructors exist to return hooks in either mode.
func (*ManageEntityCapabilities) Run ¶
func (mec *ManageEntityCapabilities) Run(e, de *pb.Entity) error
Run modifies the stored capabilities on an entity depending on the value of the mode variable. When the mode is set to true, any capabilities stored in de will be copied to e if they are not already present. In false capabilities will be subtracted.
type ManageEntityKeys ¶
ManageEntityKeys is a configurable hook that adds and removes keys.
type ManageEntityUM ¶
ManageEntityUM is a configurable plugin that manages the untyped metadata for entities.
func (*ManageEntityUM) Run ¶
func (mm *ManageEntityUM) Run(e, de *pb.Entity) error
Run will process metadata provided via de onto e according to the mode the plugin is configured for. "UPSERT" will add or update fields as appropriate. "CLEARFUZZY" will ignore Z-Indexing annotations. "CLEAREXACT" will require exact key specifications.
type ManageGroupCapabilities ¶
ManageGroupCapabilities is a configurable runtime hook that adds or removes capabilities as configured. Two convenience constructors exist to return hooks in either mode.
func (*ManageGroupCapabilities) Run ¶
func (mec *ManageGroupCapabilities) Run(g, dg *pb.Group) error
Run modifies the stored capabilities on an entity depending on the value of the mode variable. When the mode is set to true, any capabilities stored in de will be copied to e if they are not already present. In false capabilities will be subtracted.
type ManageGroupUM ¶
ManageGroupUM is a configurable plugin that manages the untyped metadata for groups.
func (*ManageGroupUM) Run ¶
func (mm *ManageGroupUM) Run(g, dg *pb.Group) error
Run will process metadata provided via dg onto g according to the mode the plugin is configured for. "UPSERT" will add or update fields as appropriate. "CLEARFUZZY" will ignore Z-Indexing annotations. "CLEAREXACT" will require exact key specifications.
type MergeEntityMeta ¶
MergeEntityMeta provides a hook to copy metadata fields from the dataEntity to the entity.
type MergeGroupMeta ¶
MergeGroupMeta provides a hook to copy metadata fields from the dataGroup to the group.
type PatchGroupExpansions ¶
PatchGroupExpansions handles the application of group expansions. Checks that verify the referential integrity of these expansions should have already run before executing this hook.
type SaveEntity ¶
SaveEntity is designed to be a terminal processor in a chain. On success, the provided entity will be saved to the data store.
type SaveGroup ¶
SaveGroup is a hook intended to terminate processing chains by saving a modified group to the database.
type SetEntityID ¶
SetEntityID copies the ID from one entity to another.
type SetEntityNumber ¶
SetEntityNumber sets the number on an entity either statically with the number provided or dynamically with an automatically chosen number.
func (*SetEntityNumber) Run ¶
func (s *SetEntityNumber) Run(e, de *pb.Entity) error
Run will provision a number in one of two ways. If the number is not equal to -1 then it will be used directly with no further checks and will be applied to the entity. If the number is -1 then the data storage system will be queried for the next available number. These numbers are not guaranteed to be in order or have any mathematical progression, only uniqueness.
type SetEntitySecret ¶
SetEntitySecret takes a plaintext secret and converts it to a secured secret for storage.
type SetGroupDisplayName ¶
SetGroupDisplayName copies the display name from dg to g.
type SetGroupName ¶
SetGroupName copies the name from dg to g.
type SetGroupNumber ¶
SetGroupNumber assigns a group number either by using the statically provided one, or dynamically requesting one from the database.
func (*SetGroupNumber) Run ¶
func (s *SetGroupNumber) Run(g, dg *pb.Group) error
Run will set the group number on g. If dg.Number is provided as a non-zero positive integer, it will be used directly (care should be taken this number is not already allocated). If dg.Number is -1, a number will be dynamically provisioned by the database. It is recommended to use automatic provisioning unless strictly necessary to do otherwise.
type SetManagingGroup ¶
SetManagingGroup performs validation checks on the managing group and then sets it.
func (*SetManagingGroup) Run ¶
func (c *SetManagingGroup) Run(g, dg *pb.Group) error
Run will attempt to set the managing group of g to the specified group on dg. If the managing group is the empty string, i.e. unmanaged, the hook will return immediately, otherwise the group is checked for either existence, or identity to the group being created.
type ValidateEntitySecret ¶
ValidateEntitySecret passes the secret to the crypto engine for validation.
type ValidateEntityUnlocked ¶
ValidateEntityUnlocked returns an error if the entity is locked.
Source Files ¶
- check-expansion-cycle.go
- check-expansion-targets.go
- check-immediate-expansions.go
- create-entity-if-missing.go
- destroy-entity.go
- destroy-group.go
- direct-groups.go
- ensure-entity-meta.go
- entity-capabilities.go
- entity-keys.go
- entity-locks.go
- fail-on-existing-entity.go
- fail-on-existing-group.go
- group-capabilities.go
- helpers.go
- load-entity.go
- load-group.go
- merge-entity-meta.go
- merge-group-meta.go
- patch-group-expansions.go
- save-entity.go
- save-group.go
- set-entity-id.go
- set-entity-number.go
- set-entity-secret.go
- set-group-display-name.go
- set-group-name.go
- set-group-number.go
- set-managing-group.go
- untyped-entity-meta.go
- untyped-group-meta.go
- validate-entity-secret.go
- validate-entity-unlocked.go