Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // AutoEntityActions is a list of all actions which get // automatically generated hooks inserted into the tree // processing system. AutoEntityActions = [...]PluginAction{ EntityCreate, EntityUpdate, EntityLock, EntityUnlock, EntityDestroy, PreSecretChange, PostSecretChange, PreAuthCheck, PostAuthCheck, } // AutoGroupActions is the same as AutoEntityActions, but has // been split out since entities and groups have different // signatures for their respective hooks. AutoGroupActions = [...]PluginAction{ GroupCreate, GroupUpdate, GroupDestroy, } // AutoHookPriority is used to determine where a hook is to be // sequenced in to a chain based on priority. AutoHookPriority = map[PluginAction]int{ EntityCreate: 70, EntityUpdate: 70, EntityLock: 70, EntityUnlock: 70, EntityDestroy: 70, GroupCreate: 70, GroupUpdate: 70, GroupDestroy: 70, PreSecretChange: 40, PostSecretChange: 60, PreAuthCheck: 15, PostAuthCheck: 60, } )
Functions ¶
This section is empty.
Types ¶
type GoPlugin ¶
type GoPlugin interface {
ProcessEntity(PluginOpts, *PluginResult) error
ProcessGroup(PluginOpts, *PluginResult) error
}
GoPlugin is the actual interface that's exposed across the link.
type GoPluginClient ¶
type GoPluginClient struct {
GoPlugin
// contains filtered or unexported fields
}
GoPluginClient is an RPC Servable type that can be used with Hashicorp's go-plugin in order to provide the transport for the actual Plugin interface.
func (*GoPluginClient) ProcessEntity ¶
func (c *GoPluginClient) ProcessEntity(opts PluginOpts) (PluginResult, error)
ProcessEntity on the GoPluginClient provides a much cleaner interface than a raw net/rpc connection. ProcessEntity handles modifications that handle entities only.
func (*GoPluginClient) ProcessGroup ¶
func (c *GoPluginClient) ProcessGroup(opts PluginOpts) (PluginResult, error)
ProcessGroup on the GoPluginClient provides a much cleaner interface than a raw net/rpc connection. ProcessGroup handles modifications that handle entities only.
type GoPluginRPC ¶
type GoPluginRPC struct {
Mux pluginMux
}
GoPluginRPC is a binding only type that's used to provide the interface required by go-plugin.
type GoPluginServer ¶
type GoPluginServer struct {
Mux pluginMux
}
GoPluginServer implements the net/rpc server that GoPluginRPC talks to.
func (*GoPluginServer) ProcessEntity ¶
func (p *GoPluginServer) ProcessEntity(opts PluginOpts, res *PluginResult) error
ProcessEntity on the GoPluginServer type implements a net/rpc server method that handles entities.
func (*GoPluginServer) ProcessGroup ¶
func (p *GoPluginServer) ProcessGroup(opts PluginOpts, res *PluginResult) error
ProcessGroup on the GoPluginServer type implements a net/rpc server that handles groups.
type Plugin ¶
type Plugin interface {
EntityCreate(pb.Entity, pb.Entity) (pb.Entity, error)
EntityUpdate(pb.Entity) (pb.Entity, error)
EntityLock(pb.Entity) (pb.Entity, error)
EntityUnlock(pb.Entity) (pb.Entity, error)
EntityDestroy(pb.Entity) (pb.Entity, error)
GroupCreate(pb.Group) (pb.Group, error)
GroupUpdate(pb.Group) (pb.Group, error)
GroupDestroy(pb.Group) (pb.Group, error)
PreSecretChange(pb.Entity, pb.Entity) (pb.Entity, error)
PostSecretChange(pb.Entity, pb.Entity) (pb.Entity, error)
PreAuthCheck(pb.Entity, pb.Entity) (pb.Entity, error)
PostAuthCheck(pb.Entity, pb.Entity) (pb.Entity, error)
}
Plugin is the type for plugins that extend the functionality of the built in tree management system. The most common type of plugin is one that will propogate changes to a system external to NetAuth.
type PluginAction ¶
type PluginAction int
PluginAction is used to swich handlers inside a ProcessEntity or ProcessGroup handler.
const ( EntityCreate PluginAction = iota EntityUpdate EntityLock EntityUnlock EntityDestroy GroupCreate GroupUpdate GroupDestroy PreSecretChange PostSecretChange PreAuthCheck PostAuthCheck )
These constants are used to switch actions inside the plugins themselves.
func (PluginAction) String ¶
func (i PluginAction) String() string
type PluginOpts ¶
type PluginOpts struct {
Action PluginAction
Entity *pb.Entity
DataEntity *pb.Entity
Group *pb.Group
DataGroup *pb.Group
}
PluginOpts provides a clean transport for data that needs to be fed into a plugin. Note that this is used for both group and entity operations, but not all fields are required to be populated.