diff --git a/automation/check_tls.py b/automation/check_tls.py index 63349c9..35233d4 100755 --- a/automation/check_tls.py +++ b/automation/check_tls.py @@ -78,7 +78,8 @@ def main(): access_token = apigee_auth.get_access_token(username, password) # Add Auth Header by default to all requests. - REQUEST.headers.update({'Authorization': f'Bearer {access_token}'}) + REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) + REQUEST.cookies.update({'access_token': access_token}) keystore_name = apigee_tls_keystore.get_keystore_from_reference(REQUEST, org_name, env_name, ref_name) crt = apigee_tls_keystore.get_cert_from_alias(REQUEST, org_name, env_name, keystore_name) diff --git a/automation/generate_report.py b/automation/generate_report.py index e2bea79..ec05719 100755 --- a/automation/generate_report.py +++ b/automation/generate_report.py @@ -98,6 +98,7 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) + REQUEST.cookies.update({'access_token': access_token}) # Read JSON file containing analytics query setup information. data = open(query_path, 'r', encoding='utf8').read() diff --git a/automation/get_target_servers.py b/automation/get_target_servers.py index 45db24a..8e2b3a4 100755 --- a/automation/get_target_servers.py +++ b/automation/get_target_servers.py @@ -99,6 +99,7 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) + REQUEST.cookies.update({'access_token': access_token}) result = [] diff --git a/automation/upload_api_product.py b/automation/upload_api_product.py index b232886..2ad049e 100755 --- a/automation/upload_api_product.py +++ b/automation/upload_api_product.py @@ -117,6 +117,7 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) + REQUEST.cookies.update({'access_token': access_token}) # Read JSON file containing API Product setup information. data = open(product_path, 'r', encoding='utf8').read() diff --git a/automation/upload_assets.py b/automation/upload_assets.py index 1f8cb42..9c69066 100755 --- a/automation/upload_assets.py +++ b/automation/upload_assets.py @@ -104,6 +104,7 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) + REQUEST.cookies.update({'access_token': access_token}) # Check portal and add it if not present portal = apigee_portal.get_portal(REQUEST, org_name, portal_name) diff --git a/automation/upload_pages.py b/automation/upload_pages.py index cb8603e..948f8c8 100755 --- a/automation/upload_pages.py +++ b/automation/upload_pages.py @@ -150,6 +150,7 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token), 'Content-Type': 'application/json'}) + REQUEST.cookies.update({'access_token': access_token}) # Check portal and add it if not present portal = apigee_portal.get_portal(REQUEST, org_name, portal_name) diff --git a/automation/upload_portal.py b/automation/upload_portal.py index d5ee673..33a3f73 100755 --- a/automation/upload_portal.py +++ b/automation/upload_portal.py @@ -72,8 +72,6 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token), 'Content-Type': 'application/json'}) - - # Auth cookies Fix: copied from upload_portal_documentation.py:206 REQUEST.cookies.update({'access_token': access_token}) # Load portal configuration ... add or update it. diff --git a/automation/upload_portal_documentation.py b/automation/upload_portal_documentation.py index 014b95f..b27fdb0 100755 --- a/automation/upload_portal_documentation.py +++ b/automation/upload_portal_documentation.py @@ -202,8 +202,6 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) - - # This seems to be expected as of 26/7/2024 REQUEST.cookies.update({'access_token': access_token}) #Check portal and add it if not present diff --git a/automation/upload_single_asset.py b/automation/upload_single_asset.py index 1ae4851..2ebfe2b 100755 --- a/automation/upload_single_asset.py +++ b/automation/upload_single_asset.py @@ -71,6 +71,7 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) + REQUEST.cookies.update({'access_token': access_token}) # Check portal and add it if not present portal = apigee_portal.get_portal(REQUEST, org_name, portal_name) diff --git a/automation/upload_spec.py b/automation/upload_spec.py index 0bc27ef..d12b16e 100755 --- a/automation/upload_spec.py +++ b/automation/upload_spec.py @@ -162,8 +162,6 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) - - # This seems to be expected as of 26/7/2024 REQUEST.cookies.update({'access_token': access_token}) # Retrieve all the API specs diff --git a/automation/upload_theme.py b/automation/upload_theme.py index ac32c43..15864f0 100755 --- a/automation/upload_theme.py +++ b/automation/upload_theme.py @@ -111,6 +111,7 @@ def main(): # Add Auth Header by default to all requests. REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token), 'Content-Type': 'application/json'}) + REQUEST.cookies.update({'access_token': access_token}) # Check portal and add it if not present portal = apigee_portal.get_portal(REQUEST, org_name, portal_name) diff --git a/automation/upload_tls.py b/automation/upload_tls.py index 7873d9a..033aad6 100755 --- a/automation/upload_tls.py +++ b/automation/upload_tls.py @@ -111,7 +111,8 @@ def main(): access_token = apigee_auth.get_access_token(username, password) # Add Auth Header by default to all requests. - REQUEST.headers.update({'Authorization': f'Bearer {access_token}'}) + REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) + REQUEST.cookies.update({'access_token': access_token}) # Retrieve all the keystore keystore_list = apigee_tls_keystore.get_keystores_list(REQUEST, org_name, env_name) diff --git a/automation/upload_tls_alias.py b/automation/upload_tls_alias.py index 809ecb2..b2519ef 100755 --- a/automation/upload_tls_alias.py +++ b/automation/upload_tls_alias.py @@ -85,7 +85,8 @@ def main(): access_token = apigee_auth.get_access_token(username, password) # Add Auth Header by default to all requests. - REQUEST.headers.update({'Authorization': f'Bearer {access_token}'}) + REQUEST.headers.update({'Authorization': 'Bearer {}'.format(access_token)}) + REQUEST.cookies.update({'access_token': access_token}) # Retrieve all the keystore keystores_list = apigee_tls_keystore.get_keystores_list(REQUEST, org_name, env_name)