From 75b03f5ff9628a38e9e31ae42114d2b7fc7785c2 Mon Sep 17 00:00:00 2001
From: Pradyumna <pradyumnan@ilimi.in>
Date: Mon, 15 Nov 2021 14:44:03 +0530
Subject: [PATCH] SB-27532 feat: Private APIs for enrolment read and list
 (#3005)

---
 ansible/roles/kong-api/defaults/main.yml | 54 ++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml
index 7ff70df3f..125daf75f 100644
--- a/ansible/roles/kong-api/defaults/main.yml
+++ b/ansible/roles/kong-api/defaults/main.yml
@@ -1535,6 +1535,24 @@ kong_apis:
     - name: request-size-limiting
       config.allowed_payload_size: "{{ small_request_size_limit }}"
 
+  - name: privateListCourseEnrollments
+    uris: "{{ course_service_prefix }}/private/v1/user/enrollment/list"
+    upstream_url: "{{ lms_service_url }}/private/v1/user/courses/list"
+    strip_uri: true
+    plugins:
+    - name: jwt
+    - name: cors
+    - "{{ statsd_pulgin }}"
+    - name: acl
+      config.whitelist:
+        - 'privateCourseAccess'
+    - name: rate-limiting
+      config.policy: local
+      config.hour: "{{ medium_rate_limit_per_hour }}"
+      config.limit_by: credential
+    - name: request-size-limiting
+      config.allowed_payload_size: "{{ small_request_size_limit }}"
+
   - name: listUserCourseEnrollments
     uris: "{{ course_service_prefix }}/v2/user/enrollment/list"
     upstream_url: "{{ lms_service_url }}/v2/user/courses/list"
@@ -1553,6 +1571,24 @@ kong_apis:
     - name: request-size-limiting
       config.allowed_payload_size: "{{ small_request_size_limit }}"
 
+  - name: privateListUserCourseEnrollments
+    uris: "{{ course_service_prefix }}/private/v2/user/enrollment/list"
+    upstream_url: "{{ lms_service_url }}/private/v2/user/courses/list"
+    strip_uri: true
+    plugins:
+    - name: jwt
+    - name: cors
+    - "{{ statsd_pulgin }}"
+    - name: acl
+      config.whitelist:
+        - 'privateCourseAccess'
+    - name: rate-limiting
+      config.policy: local
+      config.hour: "{{ medium_rate_limit_per_hour }}"
+      config.limit_by: credential
+    - name: request-size-limiting
+      config.allowed_payload_size: "{{ small_request_size_limit }}"
+
 
   - name: listDialcodes
     uris: "{{ dialcode_service_prefix }}/v1/list"
@@ -2265,6 +2301,24 @@ kong_apis:
       config.limit_by: credential
     - name: request-size-limiting
       config.allowed_payload_size: "{{ small_request_size_limit }}"
+  
+  - name: privateReadContentState
+    uris: "{{ course_service_prefix }}/private/v1/content/state/read"
+    upstream_url: "{{ lms_service_url }}/private/v1/content/state/read"
+    strip_uri: true
+    plugins:
+    - name: jwt
+    - name: cors
+    - "{{ statsd_pulgin }}"
+    - name: acl
+      config.whitelist:
+        - 'privateCourseAccess'
+    - name: rate-limiting
+      config.policy: local
+      config.hour: "{{ medium_rate_limit_per_hour }}"
+      config.limit_by: credential
+    - name: request-size-limiting
+      config.allowed_payload_size: "{{ small_request_size_limit }}"
 
   - name: readCourse
     uris: "{{ course_service_prefix }}/v1/read"
-- 
GitLab