Documentation ¶
Overview ¶
Package consulacl provides types and functions for working with consul ACL rules
Index ¶
- Constants
- type Grant
- type GrantMap
- type Policy
- func (p *Policy) Agent() *GrantMap
- func (p *Policy) Clone() *Policy
- func (p *Policy) Equals(other *Policy) bool
- func (p *Policy) Event() *GrantMap
- func (p *Policy) GenerateRules() string
- func (p *Policy) GetKeyring() Grant
- func (p *Policy) GetOperator() Grant
- func (p *Policy) Key() *GrantMap
- func (p *Policy) Node() *GrantMap
- func (p *Policy) Query() *GrantMap
- func (p *Policy) Service() *GrantMap
- func (p *Policy) Session() *GrantMap
- func (p *Policy) SetKeyring(grant Grant)
- func (p *Policy) SetOperator(grant Grant)
Constants ¶
const ( // GrantNone is fully virtual and defines that no access should be granted GrantNone = iota // GrantDeny defines that access should be denied GrantDeny // GrantList defines that listing is allowed (Consul 1.0+ with acl_enable_key_list policy configured) GrantList // GrantRead defines that read operations are allowed GrantRead // GrantWrite defines that write operations are allowed GrantWrite )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Grant ¶
type Grant uint8
Grant defines the policy grant type
func GrantByName ¶
GrantByName returns the grant by its specified name
If no grant by the given name could be found GrantNone will be returned
type GrantMap ¶
type GrantMap struct {
// contains filtered or unexported fields
}
GrantMap defines the type holding grant maps
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy represents a consul ACL policy
func NewPolicyFromACLPolicy ¶
NewPolicyFromACLPolicy constructs a new policy and fills its state with the state represented by the provided aclPolicy
func NewPolicyFromRules ¶
NewPolicyFromRules constructs a new policy and fills its state with the state represented by the rules string
func (*Policy) GenerateRules ¶
GenerateRules constructs a rules string from the defined policy
func (*Policy) GetKeyring ¶
GetKeyring retrieves the keyring grant
func (*Policy) GetOperator ¶
GetOperator retrieves the operator grant
func (*Policy) SetKeyring ¶
SetKeyring configures the keyring grant
func (*Policy) SetOperator ¶
SetOperator configures the operator grant