From 54c8707498c48d39e4a66d0612d1e9a5c312056b Mon Sep 17 00:00:00 2001 From: kAy Date: Mon, 27 Nov 2023 12:22:17 +1100 Subject: [PATCH] Adding endpoint in POCO for polli tests (#2571) - Adding the api config in poco for Polli tests --- etc/poco/bundle/extras-prod-test.json | 32 ++++++++++++++++++++++++++- etc/poco/bundle/extras-prod.json | 20 +++++++++++++++-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/etc/poco/bundle/extras-prod-test.json b/etc/poco/bundle/extras-prod-test.json index c0b37e723e..f133610fef 100644 --- a/etc/poco/bundle/extras-prod-test.json +++ b/etc/poco/bundle/extras-prod-test.json @@ -79,6 +79,36 @@ "pollinator-check/b33f33a7-c308-468e-a2a2-06c1f2443bfb" ], "allowed": false + }, + { + "name": "Allow Pollinator Pollinator test to call API configuration POST endpoint", + "path": "/api/configuration", + "method": "POST", + "mechanism": "asap", + "principals": [ + "pollinator-check/98a88b09-1541-4c0d-aded-4f1cc467d1fd" + ], + "allowed": true + }, + { + "name": "Not allow Pollinator Pollinator test to call API configuration POST endpoint for any other principals", + "path": "/api/configuration", + "method": "POST", + "mechanism": "asap", + "principals": [ + "pollinator-check/random-one" + ], + "allowed": false + }, + { + "name": "Not allow Pollinator Pollinator test to call any API configuration endpoint except POST", + "path": "/api/configuration", + "method": "GET", + "mechanism": "asap", + "principals": [ + "pollinator-check/random-one" + ], + "allowed": false } - ] + ] } diff --git a/etc/poco/bundle/extras-prod.json b/etc/poco/bundle/extras-prod.json index 97711dff48..b2584a47af 100644 --- a/etc/poco/bundle/extras-prod.json +++ b/etc/poco/bundle/extras-prod.json @@ -1,7 +1,7 @@ { "allow": [ { - "description": "Allow prod pollinator checks to call endpoints for testing", + "description": "Allow prod pollinator checks to call delete installation endpoints for testing", "paths": [ "/api/deleteInstallation/**" ], @@ -18,6 +18,22 @@ ] } } - } + }, + { + "description": "Allow prod pollinator checks to call post configuration endpoints for testing", + "paths": [ + "/api/configuration" + ], + "methods": [ + "POST" + ], + "principals": { + "asap": { + "issuers": [ + "pollinator-check/98a88b09-1541-4c0d-aded-4f1cc467d1fd" + ] + } + } + } ] }