mirror of https://github.com/status-im/consul.git
acl: Change types
This commit is contained in:
parent
338f11c6cf
commit
50ba1f6067
|
@ -5,9 +5,6 @@ import (
|
||||||
"github.com/hashicorp/hcl"
|
"github.com/hashicorp/hcl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KeyPolicyType controls the various access levels for keys
|
|
||||||
type KeyPolicyType string
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
KeyPolicyDeny = "deny"
|
KeyPolicyDeny = "deny"
|
||||||
KeyPolicyRead = "read"
|
KeyPolicyRead = "read"
|
||||||
|
@ -23,7 +20,11 @@ type Policy struct {
|
||||||
// KeyPolicy represents a policy for a key
|
// KeyPolicy represents a policy for a key
|
||||||
type KeyPolicy struct {
|
type KeyPolicy struct {
|
||||||
Prefix string `hcl:",key"`
|
Prefix string `hcl:",key"`
|
||||||
Policy KeyPolicyType
|
Policy string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k *KeyPolicy) GoString() string {
|
||||||
|
return fmt.Sprintf("%#v", *k)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse is used to parse the specified ACL rules into an
|
// Parse is used to parse the specified ACL rules into an
|
||||||
|
|
|
@ -46,7 +46,7 @@ key "foo/bar/baz" {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if reflect.DeepEqual(out, exp) {
|
if !reflect.DeepEqual(out, exp) {
|
||||||
t.Fatalf("bad: %#v", out)
|
t.Fatalf("bad: %#v %#v", out, exp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue