From 95b42662ee96ea7d59e4199d3d1368bdd61f5f6d Mon Sep 17 00:00:00 2001 From: Sahil-tarento <140611066+Sahil-tarento@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:40:38 +0530 Subject: [PATCH] Kong API changes for Discussion Hub --- ansible/roles/kong-api/defaults/main.yml | 138 +++++++++++++++++++---- 1 file changed, 115 insertions(+), 23 deletions(-) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index cb656ff219..765e16fc92 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -7747,29 +7747,6 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" - - - name: discussionHubAPIs - uris: "/discussion" - upstream_url: "{{ discussions_mw_url }}/discussion" - strip_uri: true - plugins: - - name: jwt - - name: cors - - "{{ statsd_pulgin }}" - - name: acl - config.whitelist: - - 'dataAccess' - - name: rate-limiting - config.policy: local - config.hour: "{{ large_rate_limit_per_hour }}" - config.limit_by: credential - - name: request-size-limiting - config.allowed_payload_size: "{{ medium_request_size_limit }}" - - name: request-transformer - config: - rename: - headers: - - nodebb_authorization_token:Authorization - name: nodebbauthAPIs uris: "/nodebb/auth/api" @@ -10340,3 +10317,118 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" + + - name: discussionHubAPIForRecent + uris: "/discussion/recent" + upstream_url: "{{ discussions_mw_url }}/discussion/recent" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - 'dataAccess' + - name: rate-limiting + config.policy: local + config.hour: "{{ large_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ medium_request_size_limit }}" + - name: request-transformer + config: + rename: + headers: + - nodebb_authorization_token:Authorization + + - name: discussionHubAPIForTags + uris: "/discussion/tags " + upstream_url: "{{ discussions_mw_url }}/discussion/tags" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - 'dataAccess' + - name: rate-limiting + config.policy: local + config.hour: "{{ large_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ medium_request_size_limit }}" + - name: request-transformer + config: + rename: + headers: + - nodebb_authorization_token:Authorization + + - name: discussionHubAPIForUserDiscussions + uris: "/discussion/user" + upstream_url: "{{ discussions_mw_url }}/discussion/user" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - 'dataAccess' + - name: rate-limiting + config.policy: local + config.hour: "{{ large_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ medium_request_size_limit }}" + - name: request-transformer + config: + rename: + headers: + - nodebb_authorization_token:Authorization + + - name: discussionHubAPIForPost + uris: "/discussion/v2/topics" + upstream_url: "{{ discussions_mw_url }}/discussion/v2/topics" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - 'dataAccess' + - name: rate-limiting + config.policy: local + config.hour: "{{ large_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ medium_request_size_limit }}" + - name: request-transformer + config: + rename: + headers: + - nodebb_authorization_token:Authorization + + - name: discussionHubAPIForCategories + uris: "/discussion/categories" + upstream_url: "{{ discussions_mw_url }}/discussion/categories" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - 'dataAccess' + - name: rate-limiting + config.policy: local + config.hour: "{{ large_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ medium_request_size_limit }}" + - name: request-transformer + config: + rename: + headers: + - nodebb_authorization_token:Authorization