From 18b0ff4a2a5864f36fdf02cf1c1f0c5d45180c3c Mon Sep 17 00:00:00 2001 From: Karan Kajla Date: Sun, 31 Mar 2024 14:18:46 -0700 Subject: [PATCH] Add 'Warrant-Token: latest' header to query calls in query-policy.json test suite --- tests/v2/query-policy.json | 71 ++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/tests/v2/query-policy.json b/tests/v2/query-policy.json index 6d2fdff..29dfba9 100644 --- a/tests/v2/query-policy.json +++ b/tests/v2/query-policy.json @@ -232,9 +232,6 @@ "request": { "method": "POST", "url": "/v2/warrants", - "headers": { - "Warrant-Token": "latest" - }, "body": { "objectType": "role", "objectId": "admin", @@ -265,9 +262,6 @@ "request": { "method": "POST", "url": "/v2/warrants", - "headers": { - "Warrant-Token": "latest" - }, "body": { "objectType": "role", "objectId": "manager", @@ -447,7 +441,10 @@ "name": "selectPermissionsWhereUserJohnIsMemberInTeam1", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:john%20is%20member&context=%7B%22team%22%3A%22team-1%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:john%20is%20member&context=%7B%22team%22%3A%22team-1%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -536,7 +533,10 @@ "name": "selectPermissionsWhereUserJohnIsMemberInTeam2", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:john%20is%20member&context=%7B%22team%22%3A%22team-2%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:john%20is%20member&context=%7B%22team%22%3A%22team-2%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -625,7 +625,10 @@ "name": "selectPermissionsWhereUserJohnIsMemberInTeam3", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:john%20is%20member&context=%7B%22team%22%3A%22team-3%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:john%20is%20member&context=%7B%22team%22%3A%22team-3%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -699,7 +702,10 @@ "name": "selectPermissionsWhereUserJaneIsMemberInTeam1", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:jane%20is%20member&context=%7B%22team%22%3A%22team-1%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:jane%20is%20member&context=%7B%22team%22%3A%22team-1%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -743,7 +749,10 @@ "name": "selectPermissionsWhereUserJaneIsMemberInTeam2", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:jane%20is%20member&context=%7B%22team%22%3A%22team-2%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:jane%20is%20member&context=%7B%22team%22%3A%22team-2%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -772,7 +781,10 @@ "name": "selectPermissionsWhereUserJaneIsMemberInTeam3", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:jane%20is%20member&context=%7B%22team%22%3A%22team-3%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:jane%20is%20member&context=%7B%22team%22%3A%22team-3%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -816,7 +828,10 @@ "name": "selectPermissionsWhereUserJamesIsMemberInTeam1", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:james%20is%20member&context=%7B%22team%22%3A%22team-1%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:james%20is%20member&context=%7B%22team%22%3A%22team-1%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -905,7 +920,10 @@ "name": "selectPermissionsWhereUserJamesIsMemberInTeam2", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:james%20is%20member&context=%7B%22team%22%3A%22team-2%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:james%20is%20member&context=%7B%22team%22%3A%22team-2%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -979,7 +997,10 @@ "name": "selectPermissionsWhereUserJamesIsMemberInTeam3", "request": { "method": "GET", - "url": "/v2/query?q=select%20permission%20where%20user:james%20is%20member&context=%7B%22team%22%3A%22team-3%22%7D" + "url": "/v2/query?q=select%20permission%20where%20user:james%20is%20member&context=%7B%22team%22%3A%22team-3%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -1244,7 +1265,10 @@ "name": "selectDocumentsWhereUserU1IsEditorViewerInTeamT1", "request": { "method": "GET", - "url": "/v2/query?q=select%20document%20where%20user:U1%20is%20editor-viewer&context=%7B%22team%22%3A%22T1%22%7D" + "url": "/v2/query?q=select%20document%20where%20user:U1%20is%20editor-viewer&context=%7B%22team%22%3A%22T1%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -1274,7 +1298,10 @@ "name": "selectDocumentsWhereUserU1IsEditorViewerInTeamT2", "request": { "method": "GET", - "url": "/v2/query?q=select%20document%20where%20user:U1%20is%20editor-viewer&context=%7B%22team%22%3A%22T2%22%7D" + "url": "/v2/query?q=select%20document%20where%20user:U1%20is%20editor-viewer&context=%7B%22team%22%3A%22T2%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -1287,7 +1314,10 @@ "name": "selectDocumentsWhereUserU2IsEditorViewerInTeamT1", "request": { "method": "GET", - "url": "/v2/query?q=select%20document%20where%20user:U2%20is%20editor-viewer&context=%7B%22team%22%3A%22T1%22%7D" + "url": "/v2/query?q=select%20document%20where%20user:U2%20is%20editor-viewer&context=%7B%22team%22%3A%22T1%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200, @@ -1300,7 +1330,10 @@ "name": "selectDocumentsWhereUserU2IsViewerInTeamT2", "request": { "method": "GET", - "url": "/v2/query?q=select%20document%20where%20user:U2%20is%20viewer&context=%7B%22team%22%3A%22T2%22%7D" + "url": "/v2/query?q=select%20document%20where%20user:U2%20is%20viewer&context=%7B%22team%22%3A%22T2%22%7D", + "headers": { + "Warrant-Token": "latest" + } }, "expectedResponse": { "statusCode": 200,