From d27a1878ca51b484e4ea3550dc0c3493bdd8e703 Mon Sep 17 00:00:00 2001 From: David Garvey Date: Thu, 21 Dec 2023 09:38:15 +0100 Subject: [PATCH 1/4] handle ngrok failure gracefully --- deployments/tyk/README.md | 5 ++-- deployments/tyk/bootstrap.sh | 48 ++++++++++++++++++++---------- deployments/tyk/docker-compose.yml | 3 +- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/deployments/tyk/README.md b/deployments/tyk/README.md index 4eacf41e..030e0bf0 100644 --- a/deployments/tyk/README.md +++ b/deployments/tyk/README.md @@ -151,13 +151,14 @@ The ngrok deployment contains a dashboard which records all requests which pass - [ngrok dashboard](http://localhost:4040) +**Important**: Ngrok requires an auth token. You must provide your own token by creating an Ngrok account via their website. Once you have an auth token (note, "auth token", not "api key", ngrok has both), add it to the Tyk Demo `.env` file as `NGROK_AUTHTOKEN` e.g. `NGROK_AUTHTOKEN=MY-AUTH-TOKEN-123`. + #### Usage The Ngrok tunnel URL is displayed in the output of the bootstrap script (`./up.sh`). The URL will be something that looks like this: `http://11e3-103-252-202-110.ngrok.io` -APIs can be accessed through the tunnel URL using the same paths as they are accessed through the Gateway URL. -For example, using the example tunnel URL provided above, the Basic Open API can be accessed as follows: +APIs can be accessed through the tunnel URL using the same paths as they are accessed through the Gateway URL. For example, using the example tunnel URL provided above, the Basic Open API can be accessed as follows: - Gateway URL: http://tyk-gateway.localhost:8080/basic-open-api/get - External Tunnel URL: http://11e3-103-252-202-110.ngrok.io/basic-open-api/get diff --git a/deployments/tyk/bootstrap.sh b/deployments/tyk/bootstrap.sh index f470e305..1633e4b3 100755 --- a/deployments/tyk/bootstrap.sh +++ b/deployments/tyk/bootstrap.sh @@ -121,7 +121,7 @@ bootstrap_progress log_message "Copying Python bundle to http-server" # we don't use a 'docker compose' command here as docker compose version 1 does not support 'cp' -docker cp $(get_service_container_id tyk-gateway):/opt/tyk-gateway/middleware/python/basic-example/bundle.zip deployments/tyk/volumes/http-server/python-basic-example.zip 2>>logs/bootstrap.log +docker cp $(get_service_container_id tyk-gateway):/opt/tyk-gateway/middleware/python/basic-example/bundle.zip deployments/tyk/volumes/http-server/python-basic-example.zip 2>> logs/bootstrap.log if [ "$?" != 0 ]; then echo "Error occurred when copying Python bundle to http-server" exit 1 @@ -478,21 +478,34 @@ fi log_ok bootstrap_progress -log_message "Getting ngrok public URL for Tyk Gateway" -ngrok_dashboard_url="http://localhost:4040" -ngrok_ip_api_endpoint="$ngrok_dashboard_url/api/tunnels/tyk-gateway" -log_message " Getting data from $ngrok_ip_api_endpoint" -ngrok_public_url=$(curl --fail --silent --show-error ${ngrok_ip_api_endpoint} | jq ".public_url" --raw-output) -if [ "$?" != 0 ]; then - echo "Error getting ngrok configuration from $ngrok_ip_api_endpoint" - exit 1 -fi -if [ "$ngrok_public_url" = "" ]; then - echo "Error: ngrok public URL is empty" - exit 1 +# Ngrok + +ngrok_available=false +if ! grep -q "NGROK_AUTHTOKEN=" .env; then + log_message "Ngrok auth token is not set, so Ngrok will not be available" + log_message "To enable Ngrok, set the NGROK_AUTHTOKEN value in the Tyk Demo .env file" +else + log_message "Getting Ngrok public URL for Tyk Gateway" + ngrok_dashboard_url="http://localhost:4040" + ngrok_ip_api_endpoint="$ngrok_dashboard_url/api/tunnels/tyk-gateway" + log_message " Getting data from $ngrok_ip_api_endpoint" + ngrok_public_url=$(curl -s --show-error ${ngrok_ip_api_endpoint} 2>> logs/bootstrap.log | jq ".public_url" --raw-output) + + # we want to handle ngrok failure gracefully, such that it doesn't prevent the bootstrap from completing + if [ "$?" != 0 ]; then + log_message " ERROR: Unable to get Ngrok configuration from $ngrok_ip_api_endpoint" + ngrok_public_url="not configured" + else + if [ "$ngrok_public_url" = "" ]; then + log_message " ERROR: The Ngrok public URL is empty" + ngrok_public_url="not configured" + else + log_message " Ngrok public URL: $ngrok_public_url" + ngrok_available=true + log_ok + fi + fi fi -log_message " Ngrok public URL: $ngrok_public_url" -log_ok log_end_deployment @@ -547,7 +560,10 @@ echo -e "\033[2K ▽ Gateway 2 ($(get_service_image_tag "tyk-gateway-2")) URL : $gateway2_base_url Gateway API Header : x-tyk-authorization - Gateway API Key : $gateway2_api_credentials + Gateway API Key : $gateway2_api_credentials" +if [ "$ngrok_available" = "true" ]; then + echo -e " ▽ Ngrok Public URL : $ngrok_public_url Dashboard URL : $ngrok_dashboard_url" +fi diff --git a/deployments/tyk/docker-compose.yml b/deployments/tyk/docker-compose.yml index b035b921..4904e7d1 100755 --- a/deployments/tyk/docker-compose.yml +++ b/deployments/tyk/docker-compose.yml @@ -149,11 +149,12 @@ services: - ./deployments/tyk/volumes/ngrok/ngrok.yml:/etc/ngrok.yml ports: - 4040:4040 + environment: + - NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN-} volumes: tyk-redis-data: tyk-mongo-data: - networks: tyk: From b5dd8f077f4a07d7948e3c1416d9e4d6768f3886 Mon Sep 17 00:00:00 2001 From: David Garvey Date: Thu, 21 Dec 2023 11:18:20 +0100 Subject: [PATCH 2/4] Add Ngrok container proxy API --- .../1/apis/api-658407d6d211770001d76011.json | 470 ++++++++++++++++++ 1 file changed, 470 insertions(+) create mode 100644 deployments/tyk/data/tyk-dashboard/1/apis/api-658407d6d211770001d76011.json diff --git a/deployments/tyk/data/tyk-dashboard/1/apis/api-658407d6d211770001d76011.json b/deployments/tyk/data/tyk-dashboard/1/apis/api-658407d6d211770001d76011.json new file mode 100644 index 00000000..63cdf1a2 --- /dev/null +++ b/deployments/tyk/data/tyk-dashboard/1/apis/api-658407d6d211770001d76011.json @@ -0,0 +1,470 @@ +{ + "created_at": "2023-12-21T09:39:34Z", + "api_model": {}, + "api_definition": { + "id": "658407d6d211770001d76011", + "name": "Ngrok Dashboard API", + "slug": "ngrok-dashboard-api", + "listen_port": 0, + "protocol": "", + "enable_proxy_protocol": false, + "api_id": "edc9b2bd3e7b4cc55c4ff0a7e1529b45", + "org_id": "5e9d9544a1dcd60001d0ed20", + "use_keyless": true, + "use_oauth2": false, + "external_oauth": { + "enabled": false, + "providers": [] + }, + "use_openid": false, + "openid_options": { + "providers": [], + "segregate_by_client": false + }, + "oauth_meta": { + "allowed_access_types": [], + "allowed_authorize_types": [], + "auth_login_redirect": "" + }, + "auth": { + "name": "", + "use_param": false, + "param_name": "", + "use_cookie": false, + "cookie_name": "", + "disable_header": false, + "auth_header_name": "Authorization", + "use_certificate": false, + "validate_signature": false, + "signature": { + "algorithm": "", + "header": "", + "use_param": false, + "param_name": "", + "secret": "", + "allowed_clock_skew": 0, + "error_code": 0, + "error_message": "" + } + }, + "auth_configs": { + "authToken": { + "name": "", + "use_param": false, + "param_name": "", + "use_cookie": false, + "cookie_name": "", + "disable_header": false, + "auth_header_name": "Authorization", + "use_certificate": false, + "validate_signature": false, + "signature": { + "algorithm": "", + "header": "", + "use_param": false, + "param_name": "", + "secret": "", + "allowed_clock_skew": 0, + "error_code": 0, + "error_message": "" + } + }, + "basic": { + "name": "", + "use_param": false, + "param_name": "", + "use_cookie": false, + "cookie_name": "", + "disable_header": false, + "auth_header_name": "Authorization", + "use_certificate": false, + "validate_signature": false, + "signature": { + "algorithm": "", + "header": "", + "use_param": false, + "param_name": "", + "secret": "", + "allowed_clock_skew": 0, + "error_code": 0, + "error_message": "" + } + }, + "coprocess": { + "name": "", + "use_param": false, + "param_name": "", + "use_cookie": false, + "cookie_name": "", + "disable_header": false, + "auth_header_name": "Authorization", + "use_certificate": false, + "validate_signature": false, + "signature": { + "algorithm": "", + "header": "", + "use_param": false, + "param_name": "", + "secret": "", + "allowed_clock_skew": 0, + "error_code": 0, + "error_message": "" + } + }, + "hmac": { + "name": "", + "use_param": false, + "param_name": "", + "use_cookie": false, + "cookie_name": "", + "disable_header": false, + "auth_header_name": "Authorization", + "use_certificate": false, + "validate_signature": false, + "signature": { + "algorithm": "", + "header": "", + "use_param": false, + "param_name": "", + "secret": "", + "allowed_clock_skew": 0, + "error_code": 0, + "error_message": "" + } + }, + "jwt": { + "name": "", + "use_param": false, + "param_name": "", + "use_cookie": false, + "cookie_name": "", + "disable_header": false, + "auth_header_name": "Authorization", + "use_certificate": false, + "validate_signature": false, + "signature": { + "algorithm": "", + "header": "", + "use_param": false, + "param_name": "", + "secret": "", + "allowed_clock_skew": 0, + "error_code": 0, + "error_message": "" + } + }, + "oauth": { + "name": "", + "use_param": false, + "param_name": "", + "use_cookie": false, + "cookie_name": "", + "disable_header": false, + "auth_header_name": "Authorization", + "use_certificate": false, + "validate_signature": false, + "signature": { + "algorithm": "", + "header": "", + "use_param": false, + "param_name": "", + "secret": "", + "allowed_clock_skew": 0, + "error_code": 0, + "error_message": "" + } + }, + "oidc": { + "name": "", + "use_param": false, + "param_name": "", + "use_cookie": false, + "cookie_name": "", + "disable_header": false, + "auth_header_name": "Authorization", + "use_certificate": false, + "validate_signature": false, + "signature": { + "algorithm": "", + "header": "", + "use_param": false, + "param_name": "", + "secret": "", + "allowed_clock_skew": 0, + "error_code": 0, + "error_message": "" + } + } + }, + "use_basic_auth": false, + "basic_auth": { + "disable_caching": false, + "cache_ttl": 0, + "extract_from_body": false, + "body_user_regexp": "", + "body_password_regexp": "" + }, + "use_mutual_tls_auth": false, + "client_certificates": [], + "upstream_certificates": {}, + "pinned_public_keys": {}, + "enable_jwt": false, + "use_standard_auth": false, + "use_go_plugin_auth": false, + "enable_coprocess_auth": false, + "custom_plugin_auth_enabled": false, + "jwt_signing_method": "", + "jwt_source": "", + "jwt_identity_base_field": "", + "jwt_client_base_field": "", + "jwt_policy_field_name": "", + "jwt_default_policies": [], + "jwt_issued_at_validation_skew": 0, + "jwt_expires_at_validation_skew": 0, + "jwt_not_before_validation_skew": 0, + "jwt_skip_kid": false, + "scopes": { + "jwt": {}, + "oidc": {} + }, + "jwt_scope_to_policy_mapping": {}, + "jwt_scope_claim_name": "", + "notifications": { + "shared_secret": "", + "oauth_on_keychange_url": "" + }, + "enable_signature_checking": false, + "hmac_allowed_clock_skew": -1, + "hmac_allowed_algorithms": [], + "request_signing": { + "is_enabled": false, + "secret": "", + "key_id": "", + "algorithm": "", + "header_list": [], + "certificate_id": "", + "signature_header": "" + }, + "base_identity_provided_by": "", + "definition": { + "enabled": false, + "name": "", + "default": "", + "location": "header", + "key": "x-api-version", + "strip_path": false, + "strip_versioning_data": false, + "versions": {} + }, + "version_data": { + "not_versioned": true, + "default_version": "", + "versions": { + "Default": { + "name": "Default", + "expires": "", + "paths": { + "ignored": [], + "white_list": [], + "black_list": [] + }, + "use_extended_paths": true, + "extended_paths": { + "persist_graphql": [] + }, + "global_headers": {}, + "global_headers_remove": [], + "global_response_headers": {}, + "global_response_headers_remove": [], + "ignore_endpoint_case": false, + "global_size_limit": 0, + "override_target": "" + } + } + }, + "uptime_tests": { + "check_list": [], + "config": { + "expire_utime_after": 0, + "service_discovery": { + "use_discovery_service": false, + "query_endpoint": "", + "use_nested_query": false, + "parent_data_path": "", + "data_path": "", + "port_data_path": "", + "target_path": "", + "use_target_list": false, + "cache_disabled": false, + "cache_timeout": 60, + "endpoint_returns_list": false + }, + "recheck_wait": 0 + } + }, + "proxy": { + "preserve_host_header": false, + "listen_path": "/ngrok-dashboard-api/", + "target_url": "http://www-ngrok:4040/api", + "disable_strip_slash": true, + "strip_listen_path": true, + "enable_load_balancing": false, + "target_list": [], + "check_host_against_uptime_tests": false, + "service_discovery": { + "use_discovery_service": false, + "query_endpoint": "", + "use_nested_query": false, + "parent_data_path": "", + "data_path": "", + "port_data_path": "", + "target_path": "", + "use_target_list": false, + "cache_disabled": false, + "cache_timeout": 0, + "endpoint_returns_list": false + }, + "transport": { + "ssl_insecure_skip_verify": false, + "ssl_ciphers": [], + "ssl_min_version": 0, + "ssl_max_version": 0, + "ssl_force_common_name_check": false, + "proxy_url": "" + } + }, + "disable_rate_limit": false, + "disable_quota": false, + "custom_middleware": { + "pre": [], + "post": [], + "post_key_auth": [], + "auth_check": { + "disabled": false, + "name": "", + "path": "", + "require_session": false, + "raw_body_only": false + }, + "response": [], + "driver": "", + "id_extractor": { + "disabled": false, + "extract_from": "", + "extract_with": "", + "extractor_config": {} + } + }, + "custom_middleware_bundle": "", + "custom_middleware_bundle_disabled": false, + "cache_options": { + "cache_timeout": 60, + "enable_cache": true, + "cache_all_safe_requests": false, + "cache_response_codes": [], + "enable_upstream_cache_control": false, + "cache_control_ttl_header": "", + "cache_by_headers": [] + }, + "session_lifetime": 0, + "active": true, + "internal": false, + "auth_provider": { + "name": "", + "storage_engine": "", + "meta": {} + }, + "session_provider": { + "name": "", + "storage_engine": "", + "meta": {} + }, + "event_handlers": { + "events": {} + }, + "enable_batch_request_support": false, + "enable_ip_whitelisting": false, + "allowed_ips": [], + "enable_ip_blacklisting": false, + "blacklisted_ips": [], + "dont_set_quota_on_create": false, + "expire_analytics_after": 0, + "response_processors": [], + "CORS": { + "enable": false, + "allowed_origins": [ + "*" + ], + "allowed_methods": [ + "GET", + "POST", + "HEAD" + ], + "allowed_headers": [ + "Origin", + "Accept", + "Content-Type", + "X-Requested-With", + "Authorization" + ], + "exposed_headers": [], + "allow_credentials": false, + "max_age": 24, + "options_passthrough": false, + "debug": false + }, + "domain": "", + "certificates": [], + "do_not_track": false, + "enable_context_vars": false, + "config_data": {}, + "config_data_disabled": false, + "tag_headers": [], + "global_rate_limit": { + "rate": 0, + "per": 0 + }, + "strip_auth_data": false, + "enable_detailed_recording": false, + "graphql": { + "enabled": false, + "execution_mode": "proxyOnly", + "version": "2", + "schema": "", + "type_field_configurations": [], + "playground": { + "enabled": false, + "path": "" + }, + "engine": { + "field_configs": [], + "data_sources": [], + "global_headers": [] + }, + "proxy": { + "auth_headers": {}, + "request_headers": {}, + "use_response_extensions": { + "on_error_forwarding": false + } + }, + "subgraph": { + "sdl": "" + }, + "supergraph": { + "subgraphs": [], + "merged_sdl": "", + "global_headers": {}, + "disable_query_batching": false + } + }, + "analytics_plugin": {}, + "tags": [], + "detailed_tracing": false + }, + "hook_references": [], + "is_site": false, + "sort_by": 0, + "user_group_owners": [], + "user_owners": [] +} From c9db92ecb525068e068127f776a3e305bd1934a3 Mon Sep 17 00:00:00 2001 From: David Garvey Date: Thu, 21 Dec 2023 11:19:32 +0100 Subject: [PATCH 3/4] Resolve Ngrok issue for geolocation test --- .../tyk/tyk_demo_tyk.postman_collection.json | 104 +++++++++++++++--- 1 file changed, 90 insertions(+), 14 deletions(-) diff --git a/deployments/tyk/tyk_demo_tyk.postman_collection.json b/deployments/tyk/tyk_demo_tyk.postman_collection.json index f2f0bd49..bad7a2dd 100644 --- a/deployments/tyk/tyk_demo_tyk.postman_collection.json +++ b/deployments/tyk/tyk_demo_tyk.postman_collection.json @@ -1,8 +1,9 @@ { "info": { - "_postman_id": "ce7dd0df-d3de-469a-b994-e40c1efea92d", + "_postman_id": "02a77c7c-11f8-4447-b52e-2e94deec4215", "name": "Tyk Demo", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "6131676" }, "item": [ { @@ -3313,7 +3314,7 @@ "get" ] }, - "description": "This request shows that `tyk-gateway-2` is not able to proxy requests for the **Basic Protected API**. \n\nA `404 Not Found` response is returned when this API is requested. This is because the API does not have any segmentation tags applied, and `tyk-gateway-2` has the segmentation tag `tyk-gateway-2`, which means that it will only load API Definitions which also have this tag. \n\n**Basic Protected API** is available through `tyk-gateway`, as it does not have segmentation enabled. This is demonstrated in the test." + "description": "This request shows that `tyk-gateway-2` is not able to proxy requests for the **Basic Protected API**.\n\nA `404 Not Found` response is returned when this API is requested. This is because the API does not have any segmentation tags applied, and `tyk-gateway-2` has the segmentation tag `tyk-gateway-2`, which means that it will only load API Definitions which also have this tag.\n\n**Basic Protected API** is available through `tyk-gateway`, as it does not have segmentation enabled. This is demonstrated in the test." }, "response": [] } @@ -6146,6 +6147,42 @@ }, "response": [] }, + { + "name": "Geolocation - pre-request validation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "if (pm.response.code != 200) {", + " console.warn(\"Unable to get Ngrok data, skipping geolocation tests\")", + " // if we can't get the Ngrok data then we need to skip the geolocation request, and move to the 'safe' post-request placeholder instead", + " postman.setNextRequest(\"Geolocation - post-request placeholder\")", + "}" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{tyk-gateway.host}}/ngrok-dashboard-api/tunnels/tyk-gateway", + "protocol": "http", + "host": [ + "{{tyk-gateway.host}}" + ], + "path": [ + "ngrok-dashboard-api", + "tunnels", + "tyk-gateway" + ] + }, + "description": "This requests checks that ngrok is operational, and if it find a problem it prevents the geolocation tests from running by redirecting the test runner to the next request." + }, + "response": [] + }, { "name": "Geolocation", "event": [ @@ -6153,16 +6190,29 @@ "listen": "prerequest", "script": { "exec": [ - "pm.sendRequest(\"http://\" + pm.variables.get(\"ngrok.host\") + \":\" + pm.variables.get(\"ngrok.port\") + \"/api/tunnels/tyk-gateway\", function (err, response) {", + "var ngrokApiEndpointUrl = \"http://\" + pm.variables.get(\"tyk-gateway.host\") + \"/ngrok-dashboard-api/tunnels/tyk-gateway\"", "", - " ngrokPublicUrl = response.json().public_url;", + "pm.sendRequest(ngrokApiEndpointUrl, function (err, response) {", + " if (err != null) {", + " console.warn(\"Error while getting Ngrok data:\", err)", + " pm.execution.skipRequest()", + " } else {", + " if (response.code != 200) {", + " console.warn(\"Error while getting Ngrok data:\", response.json())", + " pm.execution.skipRequest()", + " } else {", + " ngrokPublicUrl = response.json().public_url;", "", - " if (ngrokPublicUrl == \"\") {", - " throw new Error('Could not get Ngrok public URL.')", + " if (ngrokPublicUrl == \"\") {", + " console.warn('Could not get Ngrok public URL.')", + " pm.execution.skipRequest()", + " } else { ", + " pm.variables.set(\"ngrok.public-url\", ngrokPublicUrl);", + " }", + " }", " }", - "", - " pm.variables.set(\"ngrok.public-url\", ngrokPublicUrl);", - "});" + "});", + "" ], "type": "text/javascript" } @@ -6171,9 +6221,15 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" + "var ngrokPublicUrl = pm.variables.get(\"ngrok.public-url\");", + "", + "if (ngrokPublicUrl == null || ngrokPublicUrl == \"\") {", + " console.warn(\"Skipping Ngrok tests as no public URL set\")", + "} else {", + " pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + " });", + "}" ], "type": "text/javascript" } @@ -6192,7 +6248,27 @@ "get" ] }, - "description": "This request goes via the public Ngrok URL, which then gets routed through to the API Gateway.\n\nThe Gateway can geolocate this request, as it originates from outside of the local network. You can see the result of this in the *Activity By Location* report in the Tyk Dashboard.\n\nThe Gateway matches the IP address against the Maxmind database to find you location." + "description": "**Note**: If Ngrok is not configured, then this request will not run.\n\n---\n\nThis request goes via the public Ngrok URL, which then gets routed through to the API Gateway.\n\nThe Gateway can geolocate this request, as it originates from outside of the local network. You can see the result of this in the _Activity By Location_ report in the Tyk Dashboard.\n\nThe Gateway matches the IP address against the Maxmind database to find you location." + }, + "response": [] + }, + { + "name": "Geolocation - post-request placeholder", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{tyk-gateway.host}}/basic-open-api/get", + "protocol": "http", + "host": [ + "{{tyk-gateway.host}}" + ], + "path": [ + "basic-open-api", + "get" + ] + }, + "description": "This request serves as a placeholder, as the point to which the test runner is redirected to if ngrok data cannot be found." }, "response": [] } From c72482369a127aa11d454dd333243c296c19a678 Mon Sep 17 00:00:00 2001 From: David Garvey Date: Thu, 21 Dec 2023 11:19:57 +0100 Subject: [PATCH 4/4] ordering change --- .../policy-641c15dd0fffb800010197bf.json | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/deployments/tyk/data/tyk-dashboard/1/policies/policy-641c15dd0fffb800010197bf.json b/deployments/tyk/data/tyk-dashboard/1/policies/policy-641c15dd0fffb800010197bf.json index cef6da87..187e21f5 100644 --- a/deployments/tyk/data/tyk-dashboard/1/policies/policy-641c15dd0fffb800010197bf.json +++ b/deployments/tyk/data/tyk-dashboard/1/policies/policy-641c15dd0fffb800010197bf.json @@ -6,8 +6,8 @@ "state": "active", "access_rights_array": [ { - "api_name": "Rate Limit Path API 2", - "api_id": "c252af6eaf2e43ca5c89465af4f481c1", + "api_name": "Rate Limit Path API 1", + "api_id": "d371b83b249845a2497ab9a947fd6210", "versions": [ "Default" ], @@ -16,8 +16,8 @@ "allowed_types": [], "disable_introspection": false, "limit": { - "rate": 3, - "per": 6, + "rate": 1, + "per": 5, "throttle_interval": -1, "throttle_retry_limit": -1, "max_query_depth": -1, @@ -31,8 +31,8 @@ "allowance_scope": "" }, { - "api_name": "Rate Limit Proxy API", - "api_id": "d1dfc6a927a046c54c0ed470f19757cc", + "api_name": "Rate Limit Path API 2", + "api_id": "c252af6eaf2e43ca5c89465af4f481c1", "versions": [ "Default" ], @@ -40,13 +40,24 @@ "restricted_types": [], "allowed_types": [], "disable_introspection": false, - "limit": null, + "limit": { + "rate": 3, + "per": 6, + "throttle_interval": -1, + "throttle_retry_limit": -1, + "max_query_depth": -1, + "quota_max": -1, + "quota_renews": 0, + "quota_remaining": 0, + "quota_renewal_rate": -1, + "set_by_policy": false + }, "field_access_rights": [], "allowance_scope": "" }, { - "api_name": "Rate Limit Path API 1", - "api_id": "d371b83b249845a2497ab9a947fd6210", + "api_name": "Rate Limit Proxy API", + "api_id": "d1dfc6a927a046c54c0ed470f19757cc", "versions": [ "Default" ], @@ -54,18 +65,7 @@ "restricted_types": [], "allowed_types": [], "disable_introspection": false, - "limit": { - "rate": 1, - "per": 5, - "throttle_interval": -1, - "throttle_retry_limit": -1, - "max_query_depth": -1, - "quota_max": -1, - "quota_renews": 0, - "quota_remaining": 0, - "quota_renewal_rate": -1, - "set_by_policy": false - }, + "limit": null, "field_access_rights": [], "allowance_scope": "" }