expectErr:`invalid "data.destination" field: cannot be empty`,
},
"source-tenancy":{
tp:&pbauth.TrafficPermissions{
Destination:&pbauth.Destination{
IdentityName:"w1",
},
Action:pbauth.Action_ACTION_ALLOW,
Permissions:[]*pbauth.Permission{
{
Sources:[]*pbauth.Source{
{
Partition:"ap1",
Peer:"cl1",
SamenessGroup:"sg1",
},
},
DestinationRules:nil,
},
},
},
expectErr:`invalid element at index 0 of list "permissions": invalid element at index 0 of list "sources": invalid element at index 0 of list "source": permissions sources may not specify partitions, peers, and sameness_groups together`,
},
// TODO: remove when L7 traffic permissions are implemented
expectErr:`invalid "data.destination" field: cannot be empty`,
expectErr:`invalid element at index 0 of list "permissions": invalid element at index 0 of list "destination_rules": invalid element at index 0 of list "destination_rule": traffic permissions with L7 rules are not yet supported`,
expectErr:`invalid element at index 0 of list "permissions": invalid element at index 0 of list "sources": invalid element at index 0 of list "source": permissions sources may not specify partitions, peers, and sameness_groups together`,
expectErr:`invalid element at index 0 of list "permissions": invalid element at index 0 of list "destination_rules": invalid element at index 0 of list "destination_rule": traffic permissions with L7 rules are not yet supported`,
},
"l7-fields-header":{
tp:&pbauth.TrafficPermissions{
Destination:&pbauth.Destination{
IdentityName:"w1",
},
Action:pbauth.Action_ACTION_ALLOW,
Permissions:[]*pbauth.Permission{
{
Sources:[]*pbauth.Source{
{
Partition:"ap1",
},
},
DestinationRules:[]*pbauth.DestinationRule{
{
Header:&pbauth.DestinationRuleHeader{Name:"foo"},
},
},
},
},
},
expectErr:`invalid element at index 0 of list "permissions": invalid element at index 0 of list "destination_rules": invalid element at index 0 of list "destination_rule": traffic permissions with L7 rules are not yet supported`,