// Delete the traffic permissions without updating the caches. Ensure is default is right even when the caches contain stale data.
// Delete the traffic permissions without updating the caches. Ensure is default is right even when the caches contain stale samenessGroupsForTrafficPermission.
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`,
},
"source-has-same-tenancy-as-tp":{
id:&pbresource.ID{
Tenancy:&pbresource.Tenancy{
Partition:resource.DefaultPartitionName,
},
},
tp:&pbauth.TrafficPermissions{
Destination:&pbauth.Destination{
IdentityName:"w1",
},
Action:pbauth.Action_ACTION_ALLOW,
Permissions:[]*pbauth.Permission{
{
Sources:[]*pbauth.Source{
{
Partition:resource.DefaultPartitionName,
Peer:resource.DefaultPeerName,
SamenessGroup:"",
},
},
},
},
},
},
"source-has-partition-set":{
id:&pbresource.ID{
Tenancy:&pbresource.Tenancy{
Partition:resource.DefaultPartitionName,
},
},
tp:&pbauth.TrafficPermissions{
Destination:&pbauth.Destination{
IdentityName:"w1",
},
Action:pbauth.Action_ACTION_ALLOW,
Permissions:[]*pbauth.Permission{
{
Sources:[]*pbauth.Source{
{
Partition:"part",
Peer:resource.DefaultPeerName,
SamenessGroup:"",
},
},
},
},
},
},
"source-has-peer-set":{
id:&pbresource.ID{
Tenancy:&pbresource.Tenancy{
Partition:resource.DefaultPartitionName,
},
},
tp:&pbauth.TrafficPermissions{
Destination:&pbauth.Destination{
IdentityName:"w1",
},
Action:pbauth.Action_ACTION_ALLOW,
Permissions:[]*pbauth.Permission{
{
Sources:[]*pbauth.Source{
{
Partition:resource.DefaultNamespaceName,
Peer:"peer",
SamenessGroup:"",
},
},
},
},
},
},
"source-has-sameness-group-set":{
id:&pbresource.ID{
Tenancy:&pbresource.Tenancy{
Partition:resource.DefaultPartitionName,
},
},
tp:&pbauth.TrafficPermissions{
Destination:&pbauth.Destination{
IdentityName:"w1",
},
Action:pbauth.Action_ACTION_ALLOW,
Permissions:[]*pbauth.Permission{
{
Sources:[]*pbauth.Source{
{
Partition:resource.DefaultNamespaceName,
Peer:resource.DefaultPeerName,
SamenessGroup:"sg1",
},
},
},
},
},
},
"source-has-peer-and-partition-set":{
id:&pbresource.ID{
Tenancy:&pbresource.Tenancy{
Partition:resource.DefaultPartitionName,
},
},
tp:&pbauth.TrafficPermissions{
Destination:&pbauth.Destination{
IdentityName:"w1",
},
Action:pbauth.Action_ACTION_ALLOW,
Permissions:[]*pbauth.Permission{
{
Sources:[]*pbauth.Source{
{
Partition:"part",
Peer:"peer",
SamenessGroup:"",
},
},
},
},
},
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`,
},
"source-has-sameness-group-and-partition-set":{
id:&pbresource.ID{
Tenancy:&pbresource.Tenancy{
Partition:resource.DefaultPartitionName,
},
},
tp:&pbauth.TrafficPermissions{
Destination:&pbauth.Destination{
IdentityName:"w1",
},
Action:pbauth.Action_ACTION_ALLOW,
Permissions:[]*pbauth.Permission{
{
Sources:[]*pbauth.Source{
{
Partition:"part",
Peer:resource.DefaultPeerName,
SamenessGroup:"sg1",
},
},
},
},
},
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 "sources": invalid element at index 0 of list "source": permissions sources may not specify partitions, peers, and sameness_groups together`,