@@ -50,9 +50,10 @@ func TestMarshalUnmarshalNative(t *testing.T) {
5050
5151func TestMarshalUnmarshal (t * testing.T ) {
5252 css := & Conditions {
53- "clientIP" : & CIDRCondition {CIDR : "127.0.0.1/0" },
54- "owner" : & EqualsSubjectCondition {},
55- "role" : & StringMatchCondition {Matches : ".*" },
53+ "clientIP" : & CIDRCondition {CIDR : "127.0.0.1/0" },
54+ "owner" : & EqualsSubjectCondition {},
55+ "role" : & StringMatchCondition {Matches : ".*" },
56+ "hasElevatedPrivileges" : & BooleanCondition {BooleanValue : true },
5657 }
5758 out , err := json .Marshal (css )
5859 require .Nil (t , err )
@@ -75,15 +76,22 @@ func TestMarshalUnmarshal(t *testing.T) {
7576 "matches": ".*"
7677 }
7778 },
79+ "hasElevatedPrivileges": {
80+ "type": "BooleanCondition",
81+ "options": {
82+ "value": true
83+ }
84+ },
7885 "resourceFilter": {
7986 "type": "ResourceContainsCondition"
8087 }
8188}` ), & cs ))
8289
83- require .Len (t , cs , 4 )
90+ require .Len (t , cs , 5 )
8491 assert .IsType (t , & EqualsSubjectCondition {}, cs ["owner" ])
8592 assert .IsType (t , & CIDRCondition {}, cs ["clientIP" ])
8693 assert .IsType (t , & StringMatchCondition {}, cs ["role" ])
94+ assert .IsType (t , & BooleanCondition {}, cs ["hasElevatedPrivileges" ])
8795 assert .IsType (t , & ResourceContainsCondition {}, cs ["resourceFilter" ])
8896}
8997
0 commit comments