From dbe3266b2b4a245480a7c1a7446f97070d1d2ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Klein?= Date: Thu, 5 Oct 2017 14:57:00 +0200 Subject: [PATCH] Add node rule ACL support (fix #49) --- action/acl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action/acl.go b/action/acl.go index 83b662e..16e1633 100644 --- a/action/acl.go +++ b/action/acl.go @@ -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"` @@ -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), @@ -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":