Skip to content

Commit

Permalink
Add node rule ACL support (fix mantl#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-klein committed Oct 5, 2017
1 parent 11f6e3f commit dbe3266
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type rulePath struct {
}

type aclRule struct {
Node map[string]*rulePath `json:"node,omitempty"`
Key map[string]*rulePath `json:"key,omitempty"`
Service map[string]*rulePath `json:"service,omitempty"`
Event map[string]*rulePath `json:"event,omitempty"`
Expand Down Expand Up @@ -45,6 +46,7 @@ func getRulesString(rs []string) (string, error) {
}

rules := &aclRule{
Node: make(map[string]*rulePath),
Key: make(map[string]*rulePath),
Service: make(map[string]*rulePath),
Event: make(map[string]*rulePath),
Expand All @@ -64,6 +66,8 @@ func getRulesString(rs []string) (string, error) {
rules.Keyring = getPolicy(parts, 1)
case "key":
rules.Key[getPath(parts, 1)] = &rulePath{Policy: getPolicy(parts, 2)}
case "node":
rules.Node[getPath(parts, 1)] = &rulePath{Policy: getPolicy(parts, 2)}
case "service":
rules.Service[getPath(parts, 1)] = &rulePath{Policy: getPolicy(parts, 2)}
case "event":
Expand Down

0 comments on commit dbe3266

Please sign in to comment.