acl: Change types

This commit is contained in:
Armon Dadgar 2014-08-08 15:57:28 -07:00
parent 9a4778b7d3
commit ea1ee5c13e
2 changed files with 7 additions and 6 deletions

View File

@ -5,9 +5,6 @@ import (
"github.com/hashicorp/hcl"
)
// KeyPolicyType controls the various access levels for keys
type KeyPolicyType string
const (
KeyPolicyDeny = "deny"
KeyPolicyRead = "read"
@ -23,7 +20,11 @@ type Policy struct {
// KeyPolicy represents a policy for a key
type KeyPolicy struct {
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

View File

@ -46,7 +46,7 @@ key "foo/bar/baz" {
t.Fatalf("err: %v", err)
}
if reflect.DeepEqual(out, exp) {
t.Fatalf("bad: %#v", out)
if !reflect.DeepEqual(out, exp) {
t.Fatalf("bad: %#v %#v", out, exp)
}
}