From 647f31c56b9ccc62fadbfba1981aac280d4e9e15 Mon Sep 17 00:00:00 2001 From: chashikajw Date: Wed, 11 Oct 2023 01:16:57 +0530 Subject: [PATCH 1/7] Add scopes crs for admin --- .../admin-domain-api-httproute-1.yaml | 420 ++++++++--------- .../admin-domain-api-httproute-2.yaml | 432 ++++++++---------- .../admin-domain-api-httproute-3.yaml | 410 +++++++---------- .../admin-domain-api-httproute-4.yaml | 325 +++++-------- .../admin-domain-api-httproute-5.yaml | 259 ----------- ...e-6.yaml => admin-domain-api-scope-1.yaml} | 40 +- .../admin-ds/admin-domain-api-scope-2.yaml | 35 ++ .../admin-ds/admin-domain-api-scope-3.yaml | 35 ++ .../admin-ds/admin-domain-api-scope-4.yaml | 35 ++ .../admin-ds/admin-domain-api-scope-5.yaml | 35 ++ .../admin-ds/admin-domain-api-scope-6.yaml | 35 ++ .../admin-ds/admin-domain-api-scope-7.yaml | 35 ++ .../admin-ds/admin-domain-api-scope-8.yaml | 35 ++ .../admin-ds/admin-domain-api.yaml | 1 + 14 files changed, 921 insertions(+), 1211 deletions(-) delete mode 100644 helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-5.yaml rename helm-charts/templates/control-plane/admin-ds/{admin-domain-api-httproute-6.yaml => admin-domain-api-scope-1.yaml} (50%) create mode 100644 helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-2.yaml create mode 100644 helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-3.yaml create mode 100644 helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-4.yaml create mode 100644 helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-5.yaml create mode 100644 helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-6.yaml create mode 100644 helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-7.yaml create mode 100644 helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-8.yaml diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-1.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-1.yaml index aa1176eff..1dbf8d07f 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-1.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-1.yaml @@ -22,253 +22,207 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-1-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/policies/search" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/policies/search" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans/\\1" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans/(.*)" - method: "DELETE" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans/\\1" - backendRefs: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /deny-policies/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /deny-policies/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced" - backendRefs: + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /deny-policies/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /deny-policies/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + path: + replaceFullPath: /deny-policies/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 + type: ExtensionRef + matches: + - method: PATCH + path: + type: RegularExpression + value: /deny-policies/(.*) + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /deny-policies + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /deny-policies + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /applications/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /applications/(.*) + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /applications/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /applications/(.*) + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /applications {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-2.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-2.yaml index a6b1c1400..2bc1fda4b 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-2.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-2.yaml @@ -22,253 +22,207 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-2-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/export" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/export" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/import" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/import" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/policies/search" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/policies/search" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/application-rate-plans/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/application-rate-plans/\\1" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/business-plans/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/business-plans/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced" - backendRefs: - - group: dp.wso2.com + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /environments/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /environments/(.*) + - backendRefs: + - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /environments/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /environments/(.*) + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /environments + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /environments + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /applications/\1/change-owner + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications/(.*)/change-owner + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /api-categories/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /api-categories/(.*) + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /api-categories + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /api-categories {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-3.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-3.yaml index f4578a112..870fd7ff9 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-3.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-3.yaml @@ -22,253 +22,197 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-3-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/advanced/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/advanced/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/export" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/export" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/throttling/policies/import" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/throttling/policies/import" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/deny-policies" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/deny-policies" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/deny-policies" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/deny-policies" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/deny-policies/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/deny-policies/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/deny-policies/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/deny-policies/\\1" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/deny-policies/(.*)" - method: "PATCH" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/deny-policies/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/applications" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/applications" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /organizations + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/applications/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/applications/\\1" - backendRefs: - - group: dp.wso2.com + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /organizations + - backendRefs: + - group: dp.wso2.com kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/applications/(.*)" - method: "DELETE" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/applications/\\1" - backendRefs: - - group: dp.wso2.com + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /key-managers/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /key-managers/(.*) + - backendRefs: + - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/applications/(.*)/change-owner" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/applications/\\1/change-owner" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/environments" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/environments" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/environments" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/environments" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/environments/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/environments/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /key-managers/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /key-managers/(.*) + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /key-managers/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /key-managers/(.*) + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /key-managers + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /key-managers + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /api-categories/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /api-categories/(.*) {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-4.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-4.yaml index 84d4fea43..7859a8d44 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-4.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-4.yaml @@ -22,253 +22,140 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-4-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/environments/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/environments/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/bot-detection-data" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/bot-detection-data" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/monetization/publish-usage" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/monetization/publish-usage" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/monetization/publish-usage/status" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/monetization/publish-usage/status" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/workflows" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/workflows" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/workflows/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/workflows/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/workflows/update-workflow-status" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/workflows/update-workflow-status" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/tenant-info/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/tenant-info/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/custom-urls/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/custom-urls/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/api-categories" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/api-categories" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/api-categories" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/api-categories" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/api-categories/(.*)" - method: "PUT" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/api-categories/\\1" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-8 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /workflows/update-workflow-status + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/api-categories/(.*)" - method: "DELETE" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/api-categories/\\1" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-8 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /workflows + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/settings" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/settings" - backendRefs: + replaceFullPath: /organizations/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /organizations/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/system-scopes/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/system-scopes/\\1" - backendRefs: + replaceFullPath: /organizations/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /organizations/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/system-scopes" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/system-scopes" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + replaceFullPath: /organizations/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /organizations/(.*) + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /organization-info {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-5.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-5.yaml deleted file mode 100644 index c0bd4acf1..000000000 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-5.yaml +++ /dev/null @@ -1,259 +0,0 @@ -# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. -# -# WSO2 LLC. licenses this file to you under the Apache License, -# Version 2.0 (the "License"); you may not use this file except -# in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -{{- if .Values.wso2.apk.cp.enabled }} -apiVersion: "gateway.networking.k8s.io/v1beta1" -kind: "HTTPRoute" -metadata: - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-5 - namespace: {{ .Release.Namespace }} - labels: - api-name: "admin-domain-service" - api-version: "1.0.0" -spec: - hostnames: - - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" - rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/system-scopes" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/system-scopes" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/system-scopes/role-aliases" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/system-scopes/role-aliases" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/system-scopes/role-aliases" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/system-scopes/role-aliases" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/roles/(.*)" - method: "HEAD" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/roles/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/tenant-theme" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/tenant-theme" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/tenant-theme" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/tenant-theme" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/tenant-config" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/tenant-config" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/tenant-config" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/tenant-config" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/tenant-config-schema" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/tenant-config-schema" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/key-managers" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/key-managers" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/key-managers" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/key-managers" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/key-managers/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/key-managers/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/key-managers/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/key-managers/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/key-managers/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/key-managers/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/admin/key-managers/discover" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/admin/key-managers/discover" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" -{{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-6.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-1.yaml similarity index 50% rename from helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-6.yaml rename to helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-1.yaml index f51bdec15..8946032a2 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-6.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-1.yaml @@ -14,37 +14,21 @@ # specific language governing permissions and limitations # under the License. {{- if .Values.wso2.apk.cp.enabled }} -apiVersion: "gateway.networking.k8s.io/v1beta1" -kind: "HTTPRoute" +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope metadata: - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-6 - namespace: {{ .Release.Namespace }} labels: api-name: "admin-domain-service" api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1-uid spec: - hostnames: - - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" - rules: - - matches: - - path: - type: "PathPrefix" - value: "/api/admin/organizations" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - - matches: - - path: - type: "Exact" - value: "/api/admin/organization-info" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + names: + - apk:admin {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-2.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-2.yaml new file mode 100644 index 000000000..51590b228 --- /dev/null +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-2.yaml @@ -0,0 +1,35 @@ + +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "admin-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2-uid +spec: + names: + - apk:deny_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-3.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-3.yaml new file mode 100644 index 000000000..a51aa373c --- /dev/null +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-3.yaml @@ -0,0 +1,35 @@ + +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "admin-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3-uid +spec: + names: + - apk:application_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-4.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-4.yaml new file mode 100644 index 000000000..2e0d306db --- /dev/null +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-4.yaml @@ -0,0 +1,35 @@ + +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "admin-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4-uid +spec: + names: + - apk:environment_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-5.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-5.yaml new file mode 100644 index 000000000..6f7c47907 --- /dev/null +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-5.yaml @@ -0,0 +1,35 @@ + +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "admin-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5-uid +spec: + names: + - apk:category_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-6.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-6.yaml new file mode 100644 index 000000000..33f438065 --- /dev/null +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-6.yaml @@ -0,0 +1,35 @@ + +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "admin-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6-uid +spec: + names: + - apk:keymanager_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-7.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-7.yaml new file mode 100644 index 000000000..5263a940a --- /dev/null +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-7.yaml @@ -0,0 +1,35 @@ + +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "admin-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7-uid +spec: + names: + - apk:organization_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-8.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-8.yaml new file mode 100644 index 000000000..a0d333ce3 --- /dev/null +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-8.yaml @@ -0,0 +1,35 @@ + +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "admin-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-8 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-8-uid +spec: + names: + - apk:workflow_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api.yaml index f4389a4b5..65e2c13ef 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api.yaml @@ -22,6 +22,7 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" + uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid spec: apiName: "admin-domain-service" apiType: "REST" From 2bb94744378fd17817d9b5ced14a3be461c42eb9 Mon Sep 17 00:00:00 2001 From: chashikajw Date: Wed, 11 Oct 2023 01:17:21 +0530 Subject: [PATCH 2/7] Add scopes crs for backoffice --- .../backoffice-domain-api-httproute-1.yaml | 342 +++++++++--------- .../backoffice-domain-api-httproute-2.yaml | 262 +++++++++++--- .../backoffice-domain-api-httproute-3.yaml | 310 +++++++++------- .../backoffice-domain-api-httproute-4.yaml | 134 +++++++ .../backoffice-domain-api-scope-1.yaml | 34 ++ .../backoffice-domain-api-scope-2.yaml | 34 ++ .../backoffice-domain-api-scope-3.yaml | 34 ++ .../backoffice-domain-api-scope-4.yaml | 34 ++ .../backoffice-domain-api-scope-5.yaml | 34 ++ .../backoffice-domain-api-scope-6.yaml | 34 ++ .../backoffice-ds/backoffice-domain-api.yaml | 1 + 11 files changed, 895 insertions(+), 358 deletions(-) create mode 100644 helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-4.yaml create mode 100644 helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-1.yaml create mode 100644 helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-2.yaml create mode 100644 helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-3.yaml create mode 100644 helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-4.yaml create mode 100644 helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-5.yaml create mode 100644 helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-6.yaml diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-1.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-1.yaml index 80fad600a..7b5a721f2 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-1.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-1.yaml @@ -22,223 +22,227 @@ metadata: labels: api-name: "backoffice-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-1-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/definition" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/definition" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/resource-paths" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/resource-paths" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/thumbnail" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/thumbnail" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/thumbnail" - method: "PUT" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/thumbnail" - backendRefs: + replaceFullPath: /apis/\1/thumbnail + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/thumbnail + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/documents" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/documents" - backendRefs: + replaceFullPath: /apis/\1/thumbnail + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /apis/(.*)/thumbnail + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/documents" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/documents" - backendRefs: + replaceFullPath: /apis/\1/documents + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/documents + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/documents/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/documents/\\2" - backendRefs: + replaceFullPath: /apis/\1/documents + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /apis/(.*)/documents + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/documents/(.*)" - method: "PUT" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/documents/\\2" - backendRefs: + replaceFullPath: /apis/\1/definition + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/definition + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/documents/(.*)" - method: "DELETE" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/documents/\\2" - backendRefs: + replaceFullPath: /apis/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/documents/(.*)/content" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/documents/\\2/content" - backendRefs: + replaceFullPath: /apis/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /apis/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/documents/(.*)/content" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/documents/\\2/content" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis {{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml index 6e15e4203..36cdad88c 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml @@ -22,103 +22,247 @@ metadata: labels: api-name: "backoffice-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-2-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/comments" - method: "GET" + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/comments" - backendRefs: + replaceFullPath: /apis/\1/documents/\2/content + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: 01ee6795-ce0f-1e46-820d-1176222ae290 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/documents/(.*)/content + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/comments" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/comments" - backendRefs: + replaceFullPath: /apis/\1/documents/\2/content + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /apis/(.*)/documents/(.*)/content + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/comments/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/comments/\\2" - backendRefs: + replaceFullPath: /apis/\1/documents/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: 01ee6795-ce0f-1e46-820d-1176222ae290 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/documents/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/comments/(.*)" - method: "DELETE" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/comments/\\2" - backendRefs: + replaceFullPath: /apis/\1/documents/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /apis/(.*)/documents/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/comments/(.*)" - method: "PATCH" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/comments/\\2" - backendRefs: + replaceFullPath: /apis/\1/documents/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /apis/(.*)/documents/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/comments/(.*)/replies" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/comments/\\2/replies" - backendRefs: + replaceFullPath: /apis/\1/comments/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: 01ee6795-ce0f-1e46-820d-1176222ae290 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/comments/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /apis/\1/comments + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: 01ee6795-ce0f-1e46-820d-1176222ae290 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/comments + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /apis/\1/comments + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /apis/(.*)/comments {{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-3.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-3.yaml index 27b1e8974..562fa7509 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-3.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-3.yaml @@ -22,178 +22,228 @@ metadata: labels: api-name: "backoffice-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-3-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/subscriptions" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/subscriptions" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/subscriptions/(.*)/subscriber-info" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/subscriptions/\\1/subscriber-info" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/subscriptions/block-subscription" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/subscriptions/block-subscription" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/subscriptions/unblock-subscription" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/subscriptions/unblock-subscription" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-6 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /subscriptions/unblock-subscription + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/usage-plans" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/usage-plans" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-6 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /subscriptions/block-subscription + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/search" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/search" - backendRefs: + replaceFullPath: /subscriptions/\1/subscriber-info + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /subscriptions/(.*)/subscriber-info + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/settings" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/settings" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /subscriptions + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/api-categories" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/api-categories" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /search + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/change-lifecycle" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/change-lifecycle" - backendRefs: + replaceFullPath: /apis/\1/comments/\2/replies + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/comments/(.*)/replies + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/lifecycle-history" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/lifecycle-history" - backendRefs: + replaceFullPath: /apis/\1/comments/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /apis/(.*)/comments/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/backoffice/apis/(.*)/lifecycle-state" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/backoffice/apis/\\1/lifecycle-state" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + replaceFullPath: /apis/\1/comments/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /apis/(.*)/comments/(.*) {{- end -}} + diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-4.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-4.yaml new file mode 100644 index 000000000..e2b98b532 --- /dev/null +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-4.yaml @@ -0,0 +1,134 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: "gateway.networking.k8s.io/v1beta1" +kind: "HTTPRoute" +metadata: + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-4 + namespace: {{ .Release.Namespace }} + labels: + api-name: "backoffice-domain-service" + api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-4-uid +spec: + hostnames: + - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener + rules: + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /apis/change-lifecycle + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /apis/\1/lifecycle-state + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/lifecycle-state + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /apis/\1/lifecycle-history + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/lifecycle-history + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + type: ExtensionRef + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /api-categories +{{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-1.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-1.yaml new file mode 100644 index 000000000..0a84683a0 --- /dev/null +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-1.yaml @@ -0,0 +1,34 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "backoffice-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1-uid +spec: + names: + - apk:backoffice_admin +{{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-2.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-2.yaml new file mode 100644 index 000000000..2cf2d9a0f --- /dev/null +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-2.yaml @@ -0,0 +1,34 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "backoffice-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2-uid +spec: + names: + - apk:api_view +{{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-3.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-3.yaml new file mode 100644 index 000000000..753f867fe --- /dev/null +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-3.yaml @@ -0,0 +1,34 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "backoffice-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3-uid +spec: + names: + - apk:api_publish +{{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-4.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-4.yaml new file mode 100644 index 000000000..9ced98eae --- /dev/null +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-4.yaml @@ -0,0 +1,34 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "backoffice-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4-uid +spec: + names: + - apk:document_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-5.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-5.yaml new file mode 100644 index 000000000..b0aef40e1 --- /dev/null +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-5.yaml @@ -0,0 +1,34 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "backoffice-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5-uid +spec: + names: + - apk:comment_write +{{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-6.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-6.yaml new file mode 100644 index 000000000..195229a01 --- /dev/null +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-6.yaml @@ -0,0 +1,34 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "backoffice-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-6 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-6-uid +spec: + names: + - apk:subscription_manage +{{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api.yaml index c9a380c0f..1935e75e5 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api.yaml @@ -23,6 +23,7 @@ metadata: labels: api-name: "backoffice-domain-service" api-version: "1.0.0" + uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid spec: apiName: "Backoffice Domain API" apiType: "REST" From 3ac4cb5e1d4f227e211a51cad660db0b2f40c29a Mon Sep 17 00:00:00 2001 From: chashikajw Date: Wed, 11 Oct 2023 01:17:36 +0530 Subject: [PATCH 3/7] Add scopes crs for devportal --- .../devportal-domain-api-httproute-1.yaml | 228 +++++-------- .../devportal-domain-api-httproute-2.yaml | 283 ++++++---------- .../devportal-domain-api-httproute-3.yaml | 276 +++++++-------- .../devportal-domain-api-httproute-4.yaml | 238 +++++++------ .../devportal-domain-api-httproute-5.yaml | 320 +++++++----------- .../devportal-domain-api-httproute-6.yaml | 113 +++++++ .../devportal-domain-api-scope-1.yaml | 34 ++ 7 files changed, 704 insertions(+), 788 deletions(-) create mode 100644 helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-6.yaml create mode 100644 helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-scope-1.yaml diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-1.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-1.yaml index b6df5ced3..23519d986 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-1.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-1.yaml @@ -22,193 +22,141 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-1-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1" - backendRefs: + replaceFullPath: /apis/\1/thumbnail + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/thumbnail + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/definition" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/definition" - backendRefs: + replaceFullPath: /apis/\1/sdks/\2 + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/sdks/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/sdks/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/sdks/\\2" - backendRefs: + replaceFullPath: /apis/\1/documents/\2/content + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/documents/(.*)/content + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/documents" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/documents" - backendRefs: + replaceFullPath: /apis/\1/documents/\2 + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/documents/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/documents/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/documents/\\2" - backendRefs: + replaceFullPath: /apis/\1/documents + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/documents + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/documents/(.*)/content" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/documents/\\2/content" - backendRefs: + replaceFullPath: /apis/\1/definition + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/definition + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/thumbnail" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/thumbnail" - backendRefs: + replaceFullPath: /apis/\1 + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/ratings" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/ratings" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/user-rating" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/user-rating" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/user-rating" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/user-rating" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/user-rating" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/user-rating" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + weight: 1 + matches: + - method: GET + path: + type: RegularExpression + value: /apis {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-2.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-2.yaml index 6c2b054cf..fe60cc3c7 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-2.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-2.yaml @@ -22,238 +22,157 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-2-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/comments" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/comments" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/comments" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/comments" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/comments/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/comments/\\2" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/comments/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/comments/\\2" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/comments/(.*)" - method: "PATCH" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/comments/\\2" - backendRefs: + replaceFullPath: /apis/\1/user-rating + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/user-rating + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/comments/(.*)/replies" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/comments/\\2/replies" - backendRefs: + replaceFullPath: /apis/\1/user-rating + type: ReplaceFullPath + matches: + - method: PUT + path: + type: RegularExpression + value: /apis/(.*)/user-rating + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/topics" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/topics" - backendRefs: + replaceFullPath: /apis/\1/user-rating + type: ReplaceFullPath + matches: + - method: DELETE + path: + type: RegularExpression + value: /apis/(.*)/user-rating + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/subscription-policies" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/subscription-policies" - backendRefs: + replaceFullPath: /apis/\1/ratings + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/ratings + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/tenants" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/tenants" - backendRefs: + replaceFullPath: /apis/\1/comments/\2 + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/comments/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/recommendations" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/recommendations" - backendRefs: + replaceFullPath: /apis/\1/comments/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /apis/(.*)/comments/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/api-categories" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/api-categories" - backendRefs: + replaceFullPath: /apis/\1/comments + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/comments + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/key-managers" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/key-managers" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/graphql-policies/complexity" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/graphql-policies/complexity" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/apis/(.*)/graphql-policies/complexity/types" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/apis/\\1/graphql-policies/complexity/types" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/me/change-password" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/me/change-password" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + replaceFullPath: /apis/\1/comments + type: ReplaceFullPath + matches: + - method: POST + path: + type: RegularExpression + value: /apis/(.*)/comments {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-3.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-3.yaml index b3c6520a9..c66b3d385 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-3.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-3.yaml @@ -22,208 +22,172 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-3-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)" - method: "PUT" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/generate-keys" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/generate-keys" - backendRefs: + replaceFullPath: /applications/\1/generate-keys + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications/(.*)/generate-keys + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/map-keys" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/map-keys" - backendRefs: + replaceFullPath: /applications/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /applications/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/keys" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/keys" - backendRefs: + replaceFullPath: /applications/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /applications/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/keys/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/keys/\\2" - backendRefs: + replaceFullPath: /applications/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /applications/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/keys/(.*)" - method: "PUT" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/keys/\\2" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /applications + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/keys/(.*)/regenerate-secret" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/keys/\\2/regenerate-secret" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/keys/(.*)/clean-up" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/keys/\\2/clean-up" - backendRefs: + replaceFullPath: /apis/\1/comments/\2/replies + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /apis/(.*)/comments/(.*)/replies + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/keys/(.*)/generate-token" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/keys/\\2/generate-token" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + replaceFullPath: /apis/\1/comments/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: PATCH + path: + type: RegularExpression + value: /apis/(.*)/comments/(.*) {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-4.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-4.yaml index 581e50e63..84ac2cc82 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-4.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-4.yaml @@ -22,163 +22,187 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-4-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/oauth-keys" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/oauth-keys" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/oauth-keys/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/oauth-keys/\\2" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/oauth-keys/(.*)" - method: "PUT" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/oauth-keys/\\2" - backendRefs: + replaceFullPath: /applications/\1/oauth-keys/\2/regenerate-secret + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications/(.*)/oauth-keys/(.*)/regenerate-secret + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/oauth-keys/(.*)/regenerate-secret" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/oauth-keys/\\2/regenerate-secret" - backendRefs: + replaceFullPath: /applications/\1/oauth-keys/\2/generate-token + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications/(.*)/oauth-keys/(.*)/generate-token + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/oauth-keys/(.*)/clean-up" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/oauth-keys/\\2/clean-up" - backendRefs: + replaceFullPath: /applications/\1/oauth-keys/\2/clean-up + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications/(.*)/oauth-keys/(.*)/clean-up + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/oauth-keys/(.*)/generate-token" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/oauth-keys/\\2/generate-token" - backendRefs: + replaceFullPath: /applications/\1/oauth-keys/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /applications/(.*)/oauth-keys/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/api-keys/(.*)/generate" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/api-keys/\\2/generate" - backendRefs: + replaceFullPath: /applications/\1/oauth-keys/\2 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /applications/(.*)/oauth-keys/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/(.*)/api-keys/(.*)/revoke" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/\\1/api-keys/\\2/revoke" - backendRefs: + replaceFullPath: /applications/\1/oauth-keys + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /applications/(.*)/oauth-keys + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/export" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/export" - backendRefs: + replaceFullPath: /applications/\1/map-keys + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications/(.*)/map-keys + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/applications/import" - method: "POST" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/applications/import" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + replaceFullPath: /applications/\1/api-keys/\2/generate + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications/(.*)/api-keys/(.*)/generate {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-5.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-5.yaml index c644bdfe8..c0a33a659 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-5.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-5.yaml @@ -22,253 +22,167 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-5-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener rules: - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/subscriptions" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/subscriptions" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/subscriptions" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/subscriptions" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/subscriptions/multiple" - method: "POST" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/subscriptions/multiple" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/subscriptions/(.*)/additionalInfo" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/subscriptions/\\1/additionalInfo" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/subscriptions/(.*)" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/subscriptions/\\1" - backendRefs: + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/subscriptions/(.*)" - method: "PUT" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/subscriptions/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/subscriptions/(.*)" - method: "DELETE" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/subscriptions/\\1" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/subscriptions/(.*)/usage" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/subscriptions/\\1/usage" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /subscriptions/multiple + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/throttling-policies/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/throttling-policies/\\1" - backendRefs: + replaceFullPath: /subscriptions/\1/additionalInfo + type: ReplaceFullPath + matches: + - method: GET + path: + type: RegularExpression + value: /subscriptions/(.*)/additionalInfo + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/throttling-policies/(.*)/(.*)" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/throttling-policies/\\1/\\2" - backendRefs: + replaceFullPath: /subscriptions/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /subscriptions/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/tags" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/tags" - backendRefs: + replaceFullPath: /subscriptions/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: PUT + path: + type: RegularExpression + value: /subscriptions/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/search" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/search" - backendRefs: + replaceFullPath: /subscriptions/\1 + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: DELETE + path: + type: RegularExpression + value: /subscriptions/(.*) + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/sdk-gen/languages" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/sdk-gen/languages" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/webhooks/subscriptions" - method: "GET" - filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/webhooks/subscriptions" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /subscriptions + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/settings" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" - urlRewrite: - path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/settings" - backendRefs: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /subscriptions + - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - - matches: - - path: - type: "RegularExpression" - value: "/api/devportal/settings/application-attributes" - method: "GET" + weight: 1 filters: - - type: "URLRewrite" + - type: URLRewrite urlRewrite: path: - type: "ReplaceFullPath" - replaceFullPath: "/api/devportal/settings/application-attributes" - backendRefs: - - group: dp.wso2.com - kind: Backend - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - parentRefs: - - group: "gateway.networking.k8s.io" - kind: "Gateway" - name: "default" - sectionName: "httpslistener" + replaceFullPath: /applications/\1/api-keys/\2/revoke + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: POST + path: + type: RegularExpression + value: /applications/(.*)/api-keys/(.*)/revoke {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-6.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-6.yaml new file mode 100644 index 000000000..753eec10e --- /dev/null +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-6.yaml @@ -0,0 +1,113 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: "gateway.networking.k8s.io/v1beta1" +kind: "HTTPRoute" +metadata: + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-6 + namespace: {{ .Release.Namespace }} + labels: + api-name: "devportal-domain-service" + api-version: "1.0.0" + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-6-uid +spec: + hostnames: + - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: default + sectionName: httpslistener + rules: + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend + weight: 1 + filters: + - type: URLRewrite + urlRewrite: + path: + replaceFullPath: /subscriptions/\1/usage + type: ReplaceFullPath + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /subscriptions/(.*)/usage + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend + weight: 1 + matches: + - method: GET + path: + type: RegularExpression + value: /search + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /sdk-gen/languages + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend + weight: 1 + filters: + - extensionRef: + group: dp.wso2.com + kind: Scope + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + type: ExtensionRef + matches: + - method: GET + path: + type: RegularExpression + value: /key-managers + - backendRefs: + - group: dp.wso2.com + kind: Backend + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend + weight: 1 + matches: + - method: GET + path: + type: RegularExpression + value: /api-categories +{{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-scope-1.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-scope-1.yaml new file mode 100644 index 000000000..093352205 --- /dev/null +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-scope-1.yaml @@ -0,0 +1,34 @@ +# Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +{{- if .Values.wso2.apk.cp.enabled }} +apiVersion: dp.wso2.com/v1alpha1 +kind: Scope +metadata: + labels: + api-name: "devportal-domain-service" + api-version: "1.0.0" + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 + namespace: {{ .Release.Namespace }} + ownerReferences: + - apiVersion: dp.wso2.com/v1alpha1 + kind: API + name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid + uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1-uid +spec: + names: + - apk:subscribe +{{- end -}} From f6c2f31ddbe4b0ade6aac29e901f1ecfde131635 Mon Sep 17 00:00:00 2001 From: chashikajw Date: Mon, 16 Oct 2023 09:36:02 +0530 Subject: [PATCH 4/7] Fix backoffice issues in CRs --- .../backoffice-domain-api-backend.yaml | 1 + .../backoffice-domain-api-httproute-1.yaml | 146 +++++++--------- .../backoffice-domain-api-httproute-2.yaml | 164 ++++++++---------- .../backoffice-domain-api-httproute-3.yaml | 134 +++++++------- .../backoffice-domain-api-httproute-4.yaml | 70 ++++---- .../backoffice-domain-api-scope-1.yaml | 5 - .../backoffice-domain-api-scope-2.yaml | 5 - .../backoffice-domain-api-scope-3.yaml | 5 - .../backoffice-domain-api-scope-4.yaml | 5 - .../backoffice-domain-api-scope-5.yaml | 5 - .../backoffice-domain-api-scope-6.yaml | 5 - 11 files changed, 232 insertions(+), 313 deletions(-) diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-backend.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-backend.yaml index 553a45313..e0128eb7e 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-backend.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-backend.yaml @@ -20,6 +20,7 @@ metadata: name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend namespace: {{ .Release.Namespace }} spec: + basePath: "/api/backoffice" services: - host: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-service.{{ .Release.Namespace }} port: 9443 diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-1.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-1.yaml index 7b5a721f2..5fb15b29f 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-1.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-1.yaml @@ -22,227 +22,213 @@ metadata: labels: api-name: "backoffice-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-1-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/thumbnail - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/thumbnail" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/thumbnail + type: "RegularExpression" + value: "/apis/(.*)/thumbnail" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/thumbnail - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/thumbnail" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /apis/(.*)/thumbnail + type: "RegularExpression" + value: "/apis/(.*)/thumbnail" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/documents + type: "RegularExpression" + value: "/apis/(.*)/documents" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /apis/(.*)/documents + type: "RegularExpression" + value: "/apis/(.*)/documents" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/definition - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/definition" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/definition + type: "RegularExpression" + value: "/apis/(.*)/definition" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*) + type: "RegularExpression" + value: "/apis/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /apis/(.*) + type: "RegularExpression" + value: "/apis/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis + type: "RegularExpression" + value: "/apis" {{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml index 36cdad88c..6f1dde75a 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml @@ -22,247 +22,233 @@ metadata: labels: api-name: "backoffice-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-2-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents/\2/content - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents/\\2/content" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: 01ee6795-ce0f-1e46-820d-1176222ae290 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/documents/(.*)/content + type: "RegularExpression" + value: "/apis/(.*)/documents/(.*)/content" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents/\2/content - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents/\\2/content" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /apis/(.*)/documents/(.*)/content + type: "RegularExpression" + value: "/apis/(.*)/documents/(.*)/content" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope - name: 01ee6795-ce0f-1e46-820d-1176222ae290 - type: ExtensionRef + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/documents/(.*) + type: "RegularExpression" + value: "/apis/(.*)/documents/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /apis/(.*)/documents/(.*) + type: "RegularExpression" + value: "/apis/(.*)/documents/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /apis/(.*)/documents/(.*) + type: "RegularExpression" + value: "/apis/(.*)/documents/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope - name: 01ee6795-ce0f-1e46-820d-1176222ae290 - type: ExtensionRef + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/comments/(.*) + type: "RegularExpression" + value: "/apis/(.*)/comments/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope - name: 01ee6795-ce0f-1e46-820d-1176222ae290 - type: ExtensionRef + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/comments + type: "RegularExpression" + value: "/apis/(.*)/comments" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /apis/(.*)/comments + type: "RegularExpression" + value: "/apis/(.*)/comments" {{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-3.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-3.yaml index 562fa7509..0291b7417 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-3.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-3.yaml @@ -22,228 +22,214 @@ metadata: labels: api-name: "backoffice-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-3-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-6 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /subscriptions/unblock-subscription + type: "RegularExpression" + value: "/subscriptions/unblock-subscription" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-6 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /subscriptions/block-subscription + type: "RegularExpression" + value: "/subscriptions/block-subscription" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /subscriptions/\1/subscriber-info - type: ReplaceFullPath + replaceFullPath: "/subscriptions/\\1/subscriber-info" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /subscriptions/(.*)/subscriber-info + type: "RegularExpression" + value: "/subscriptions/(.*)/subscriber-info" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /subscriptions + type: "RegularExpression" + value: "/subscriptions" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /search + type: "RegularExpression" + value: "/search" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments/\2/replies - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments/\\2/replies" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/comments/(.*)/replies + type: "RegularExpression" + value: "/apis/(.*)/comments/(.*)/replies" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /apis/(.*)/comments/(.*) + type: "RegularExpression" + value: "/apis/(.*)/comments/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /apis/(.*)/comments/(.*) + type: "RegularExpression" + value: "/apis/(.*)/comments/(.*)" {{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-4.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-4.yaml index e2b98b532..daa53fe4e 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-4.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-4.yaml @@ -22,113 +22,103 @@ metadata: labels: api-name: "backoffice-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-4-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /apis/change-lifecycle + type: "RegularExpression" + value: "/apis/change-lifecycle" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/lifecycle-state - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/lifecycle-state" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/lifecycle-state + type: "RegularExpression" + value: "/apis/(.*)/lifecycle-state" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/lifecycle-history - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/lifecycle-history" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/lifecycle-history + type: "RegularExpression" + value: "/apis/(.*)/lifecycle-history" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /api-categories + type: "RegularExpression" + value: "/api-categories" {{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-1.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-1.yaml index 0a84683a0..b02cc1f9a 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-1.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-1.yaml @@ -22,11 +22,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-1-uid spec: names: diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-2.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-2.yaml index 2cf2d9a0f..7b52d4ea5 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-2.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-2.yaml @@ -22,11 +22,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2-uid spec: names: diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-3.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-3.yaml index 753f867fe..446c24857 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-3.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-3.yaml @@ -22,11 +22,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-3-uid spec: names: diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-4.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-4.yaml index 9ced98eae..9253a6314 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-4.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-4.yaml @@ -22,11 +22,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-4-uid spec: names: diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-5.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-5.yaml index b0aef40e1..141fa5845 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-5.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-5.yaml @@ -22,11 +22,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-5-uid spec: names: diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-6.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-6.yaml index 195229a01..a181edde9 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-6.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-scope-6.yaml @@ -22,11 +22,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-6 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-6-uid spec: names: From 5682e564b29c65a59b0bedfd6d0aad67d0404680 Mon Sep 17 00:00:00 2001 From: chashikajw Date: Mon, 16 Oct 2023 10:26:41 +0530 Subject: [PATCH 5/7] Fix admin issues in CRs --- .../admin-ds/admin-domain-api-backend.yaml | 1 + .../admin-domain-api-httproute-1.yaml | 129 ++++++++---------- .../admin-domain-api-httproute-2.yaml | 125 ++++++++--------- .../admin-domain-api-httproute-3.yaml | 122 ++++++++--------- .../admin-domain-api-httproute-4.yaml | 90 ++++++------ .../admin-ds/admin-domain-api-scope-1.yaml | 5 - .../admin-ds/admin-domain-api-scope-2.yaml | 5 - .../admin-ds/admin-domain-api-scope-3.yaml | 5 - .../admin-ds/admin-domain-api-scope-4.yaml | 5 - .../admin-ds/admin-domain-api-scope-5.yaml | 5 - .../admin-ds/admin-domain-api-scope-6.yaml | 5 - .../admin-ds/admin-domain-api-scope-7.yaml | 5 - .../admin-ds/admin-domain-api-scope-8.yaml | 5 - 13 files changed, 208 insertions(+), 299 deletions(-) diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-backend.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-backend.yaml index d006c7e3b..54cd6b377 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-backend.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-backend.yaml @@ -20,6 +20,7 @@ metadata: name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend namespace: {{ .Release.Namespace }} spec: + basePath: "/api/admin" services: - host: {{ template "apk-helm.resource.prefix" . }}-admin-ds-service.{{ .Release.Namespace }} port: 9443 diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-1.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-1.yaml index 1dbf8d07f..230fe45b0 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-1.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-1.yaml @@ -22,207 +22,194 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-1-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /deny-policies/\1 - type: ReplaceFullPath + replaceFullPath: "/deny-policies/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /deny-policies/(.*) + type: "RegularExpression" + value: "/deny-policies/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /deny-policies/\1 - type: ReplaceFullPath + replaceFullPath: "/deny-policies/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /deny-policies/(.*) + type: "RegularExpression" + value: "/deny-policies/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /deny-policies/\1 - type: ReplaceFullPath + replaceFullPath: "/deny-policies/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PATCH + - method: "PATCH" path: - type: RegularExpression - value: /deny-policies/(.*) + type: "RegularExpression" + value: "/deny-policies/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /deny-policies + type: "RegularExpression" + value: "/deny-policies" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /deny-policies + type: "RegularExpression" + value: "/deny-policies" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1 - type: ReplaceFullPath + replaceFullPath: "/applications/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /applications/(.*) + type: "RegularExpression" + value: "/applications/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1 - type: ReplaceFullPath + replaceFullPath: "/applications/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /applications/(.*) + type: "RegularExpression" + value: "/applications/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /applications + type: "RegularExpression" + value: "/applications" {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-2.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-2.yaml index 2bc1fda4b..0b3cadd49 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-2.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-2.yaml @@ -22,20 +22,14 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-2-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com @@ -43,186 +37,179 @@ spec: name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /environments/\1 - type: ReplaceFullPath + replaceFullPath: "/environments/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /environments/(.*) + type: "RegularExpression" + value: "/environments/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /environments/\1 - type: ReplaceFullPath + replaceFullPath: "/environments/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /environments/(.*) + type: "RegularExpression" + value: "/environments/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /environments + type: "RegularExpression" + value: "/environments" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /environments + type: "RegularExpression" + value: "/environments" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/change-owner - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/change-owner" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications/(.*)/change-owner + type: "RegularExpression" + value: "/applications/(.*)/change-owner" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /api-categories/\1 - type: ReplaceFullPath + replaceFullPath: "/api-categories/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /api-categories/(.*) + type: "RegularExpression" + value: "/api-categories/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /api-categories + type: "RegularExpression" + value: "/api-categories" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /api-categories + type: "RegularExpression" + value: "/api-categories" {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-3.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-3.yaml index 870fd7ff9..3214a12e4 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-3.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-3.yaml @@ -22,197 +22,183 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-3-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /organizations + type: "RegularExpression" + value: "/organizations" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /organizations + type: "RegularExpression" + value: "/organizations" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /key-managers/\1 - type: ReplaceFullPath + replaceFullPath: "/key-managers/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /key-managers/(.*) + type: "RegularExpression" + value: "/key-managers/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /key-managers/\1 - type: ReplaceFullPath + replaceFullPath: "/key-managers/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /key-managers/(.*) + type: "RegularExpression" + value: "/key-managers/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /key-managers/\1 - type: ReplaceFullPath + replaceFullPath: "/key-managers/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /key-managers/(.*) + type: "RegularExpression" + value: "/key-managers/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /key-managers + type: "RegularExpression" + value: "/key-managers" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /key-managers + type: "RegularExpression" + value: "/key-managers" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /api-categories/\1 - type: ReplaceFullPath + replaceFullPath: "/api-categories/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /api-categories/(.*) + type: "RegularExpression" + value: "/api-categories/(.*)" {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-4.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-4.yaml index 7859a8d44..1175bb7ae 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-4.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-httproute-4.yaml @@ -22,140 +22,128 @@ metadata: labels: api-name: "admin-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-4-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-8 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /workflows/update-workflow-status + type: "RegularExpression" + value: "/workflows/update-workflow-status" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-8 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /workflows + type: "RegularExpression" + value: "/workflows" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /organizations/\1 - type: ReplaceFullPath + replaceFullPath: "/organizations/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /organizations/(.*) + type: "RegularExpression" + value: "/organizations/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /organizations/\1 - type: ReplaceFullPath + replaceFullPath: "/organizations/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /organizations/(.*) + type: "RegularExpression" + value: "/organizations/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /organizations/\1 - type: ReplaceFullPath + replaceFullPath: "/organizations/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /organizations/(.*) + type: "RegularExpression" + value: "/organizations/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /organization-info + type: "RegularExpression" + value: "/organization-info" {{- end -}} diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-1.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-1.yaml index 8946032a2..a22f99f84 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-1.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-1.yaml @@ -22,11 +22,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-1-uid spec: names: diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-2.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-2.yaml index 51590b228..899f5479b 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-2.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-2.yaml @@ -23,11 +23,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-2-uid spec: names: diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-3.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-3.yaml index a51aa373c..f7a451a0d 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-3.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-3.yaml @@ -23,11 +23,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-3-uid spec: names: diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-4.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-4.yaml index 2e0d306db..e119e9f05 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-4.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-4.yaml @@ -23,11 +23,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-4-uid spec: names: diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-5.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-5.yaml index 6f7c47907..334a65312 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-5.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-5.yaml @@ -23,11 +23,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-5-uid spec: names: diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-6.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-6.yaml index 33f438065..4471308a1 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-6.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-6.yaml @@ -23,11 +23,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-6-uid spec: names: diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-7.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-7.yaml index 5263a940a..0e46c97d4 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-7.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-7.yaml @@ -23,11 +23,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-7-uid spec: names: diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-8.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-8.yaml index a0d333ce3..352059478 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-8.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api-scope-8.yaml @@ -23,11 +23,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-8 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-admin-ds-scope-8-uid spec: names: From ad1a0baa1aef182e47a4b6c53a076fae59b47077 Mon Sep 17 00:00:00 2001 From: chashikajw Date: Mon, 16 Oct 2023 10:26:54 +0530 Subject: [PATCH 6/7] Fix devportal issues in CRs --- .../devportal-domain-api-backend.yaml | 1 + .../devportal-domain-api-httproute-1.yaml | 112 +++++++-------- .../devportal-domain-api-httproute-2.yaml | 122 +++++++--------- .../devportal-domain-api-httproute-3.yaml | 120 +++++++--------- .../devportal-domain-api-httproute-4.yaml | 134 ++++++++---------- .../devportal-domain-api-httproute-5.yaml | 112 +++++++-------- .../devportal-domain-api-httproute-6.yaml | 61 ++++---- .../devportal-domain-api-scope-1.yaml | 5 - 8 files changed, 291 insertions(+), 376 deletions(-) diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-backend.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-backend.yaml index ee1cc538f..a875486fb 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-backend.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-backend.yaml @@ -20,6 +20,7 @@ metadata: name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend namespace: {{ .Release.Namespace }} spec: + basePath: "/api/devportal" services: - host: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-service.{{ .Release.Namespace }} port: 9443 diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-1.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-1.yaml index 23519d986..1334210a2 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-1.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-1.yaml @@ -22,141 +22,127 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-1-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/thumbnail - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/thumbnail" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/thumbnail + type: "RegularExpression" + value: "/apis/(.*)/thumbnail" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/sdks/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/sdks/\\2" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/sdks/(.*) + type: "RegularExpression" + value: "/apis/(.*)/sdks/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents/\2/content - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents/\\2/content" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/documents/(.*)/content + type: "RegularExpression" + value: "/apis/(.*)/documents/(.*)/content" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents/\\2" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/documents/(.*) + type: "RegularExpression" + value: "/apis/(.*)/documents/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/documents - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/documents" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/documents + type: "RegularExpression" + value: "/apis/(.*)/documents" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/definition - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/definition" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/definition + type: "RegularExpression" + value: "/apis/(.*)/definition" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*) + type: "RegularExpression" + value: "/apis/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis + type: "RegularExpression" + value: "/apis" {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-2.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-2.yaml index fe60cc3c7..c4e94af4e 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-2.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-2.yaml @@ -22,157 +22,143 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-2-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/user-rating - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/user-rating" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/user-rating + type: "RegularExpression" + value: "/apis/(.*)/user-rating" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/user-rating - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/user-rating" + type: "ReplaceFullPath" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /apis/(.*)/user-rating + type: "RegularExpression" + value: "/apis/(.*)/user-rating" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/user-rating - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/user-rating" + type: "ReplaceFullPath" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /apis/(.*)/user-rating + type: "RegularExpression" + value: "/apis/(.*)/user-rating" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/ratings - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/ratings" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/ratings + type: "RegularExpression" + value: "/apis/(.*)/ratings" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments/\\2" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/comments/(.*) + type: "RegularExpression" + value: "/apis/(.*)/comments/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /apis/(.*)/comments/(.*) + type: "RegularExpression" + value: "/apis/(.*)/comments/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/comments + type: "RegularExpression" + value: "/apis/(.*)/comments" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments" + type: "ReplaceFullPath" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /apis/(.*)/comments + type: "RegularExpression" + value: "/apis/(.*)/comments" {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-3.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-3.yaml index c66b3d385..e567f72c0 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-3.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-3.yaml @@ -22,172 +22,158 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-3-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/generate-keys - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/generate-keys" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications/(.*)/generate-keys + type: "RegularExpression" + value: "/applications/(.*)/generate-keys" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1 - type: ReplaceFullPath + replaceFullPath: "/applications/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /applications/(.*) + type: "RegularExpression" + value: "/applications/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1 - type: ReplaceFullPath + replaceFullPath: "/applications/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /applications/(.*) + type: "RegularExpression" + value: "/applications/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1 - type: ReplaceFullPath + replaceFullPath: "/applications/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: DELETE + - method: "DELETE" path: - type: RegularExpression - value: /applications/(.*) + type: "RegularExpression" + value: "/applications/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /applications + type: "RegularExpression" + value: "/applications" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications + type: "RegularExpression" + value: "/applications" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments/\2/replies - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments/\\2/replies" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /apis/(.*)/comments/(.*)/replies + type: "RegularExpression" + value: "/apis/(.*)/comments/(.*)/replies" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /apis/\1/comments/\2 - type: ReplaceFullPath + replaceFullPath: "/apis/\\1/comments/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PATCH + - method: "PATCH" path: - type: RegularExpression - value: /apis/(.*)/comments/(.*) + type: "RegularExpression" + value: "/apis/(.*)/comments/(.*)" {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-4.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-4.yaml index 84ac2cc82..e94aca1e1 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-4.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-4.yaml @@ -22,187 +22,173 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-4-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/oauth-keys/\2/regenerate-secret - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/oauth-keys/\\2/regenerate-secret" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications/(.*)/oauth-keys/(.*)/regenerate-secret + type: "RegularExpression" + value: "/applications/(.*)/oauth-keys/(.*)/regenerate-secret" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/oauth-keys/\2/generate-token - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/oauth-keys/\\2/generate-token" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications/(.*)/oauth-keys/(.*)/generate-token + type: "RegularExpression" + value: "/applications/(.*)/oauth-keys/(.*)/generate-token" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/oauth-keys/\2/clean-up - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/oauth-keys/\\2/clean-up" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications/(.*)/oauth-keys/(.*)/clean-up + type: "RegularExpression" + value: "/applications/(.*)/oauth-keys/(.*)/clean-up" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/oauth-keys/\2 - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/oauth-keys/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /applications/(.*)/oauth-keys/(.*) + type: "RegularExpression" + value: "/applications/(.*)/oauth-keys/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/oauth-keys/\2 - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/oauth-keys/\\2" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /applications/(.*)/oauth-keys/(.*) + type: "RegularExpression" + value: "/applications/(.*)/oauth-keys/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/oauth-keys - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/oauth-keys" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /applications/(.*)/oauth-keys + type: "RegularExpression" + value: "/applications/(.*)/oauth-keys" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/map-keys - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/map-keys" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications/(.*)/map-keys + type: "RegularExpression" + value: "/applications/(.*)/map-keys" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/api-keys/\2/generate - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/api-keys/\\2/generate" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications/(.*)/api-keys/(.*)/generate + type: "RegularExpression" + value: "/applications/(.*)/api-keys/(.*)/generate" {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-5.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-5.yaml index c0a33a659..0e7a0af21 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-5.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-5.yaml @@ -22,167 +22,153 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-5-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /subscriptions/multiple + type: "RegularExpression" + value: "/subscriptions/multiple" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /subscriptions/\1/additionalInfo - type: ReplaceFullPath + replaceFullPath: "/subscriptions/\\1/additionalInfo" + type: "ReplaceFullPath" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /subscriptions/(.*)/additionalInfo + type: "RegularExpression" + value: "/subscriptions/(.*)/additionalInfo" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /subscriptions/\1 - type: ReplaceFullPath + replaceFullPath: "/subscriptions/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /subscriptions/(.*) + type: "RegularExpression" + value: "/subscriptions/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /subscriptions/\1 - type: ReplaceFullPath + replaceFullPath: "/subscriptions/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: PUT + - method: "PUT" path: - type: RegularExpression - value: /subscriptions/(.*) + type: "RegularExpression" + value: "/subscriptions/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /subscriptions/\1 - type: ReplaceFullPath + replaceFullPath: "/subscriptions/\\1" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - method: DELETE path: - type: RegularExpression - value: /subscriptions/(.*) + type: "RegularExpression" + value: "/subscriptions/(.*)" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /subscriptions + type: "RegularExpression" + value: "/subscriptions" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /subscriptions + type: "RegularExpression" + value: "/subscriptions" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /applications/\1/api-keys/\2/revoke - type: ReplaceFullPath + replaceFullPath: "/applications/\\1/api-keys/\\2/revoke" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: POST + - method: "POST" path: - type: RegularExpression - value: /applications/(.*)/api-keys/(.*)/revoke + type: "RegularExpression" + value: "/applications/(.*)/api-keys/(.*)/revoke" {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-6.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-6.yaml index 753eec10e..931b8dd5f 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-6.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-httproute-6.yaml @@ -22,92 +22,81 @@ metadata: labels: api-name: "devportal-domain-service" api-version: "1.0.0" - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-6-uid spec: hostnames: - "{{ .Values.wso2.apk.listener.hostname | default "api.am.wso2.com"}}" parentRefs: - - group: gateway.networking.k8s.io - kind: Gateway - name: default - sectionName: httpslistener + - group: "gateway.networking.k8s.io" + kind: "Gateway" + name: "default" + sectionName: "httpslistener" rules: - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - - type: URLRewrite + - type: "URLRewrite" urlRewrite: path: - replaceFullPath: /subscriptions/\1/usage - type: ReplaceFullPath + replaceFullPath: "/subscriptions/\\1/usage" + type: "ReplaceFullPath" - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /subscriptions/(.*)/usage + type: "RegularExpression" + value: "/subscriptions/(.*)/usage" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /search + type: "RegularExpression" + value: "/search" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /sdk-gen/languages + type: "RegularExpression" + value: "/sdk-gen/languages" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 filters: - extensionRef: group: dp.wso2.com kind: Scope name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 - type: ExtensionRef + type: "ExtensionRef" matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /key-managers + type: "RegularExpression" + value: "/key-managers" - backendRefs: - group: dp.wso2.com kind: Backend name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-backend - weight: 1 matches: - - method: GET + - method: "GET" path: - type: RegularExpression - value: /api-categories + type: "RegularExpression" + value: "/api-categories" {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-scope-1.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-scope-1.yaml index 093352205..26814ba9a 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-scope-1.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api-scope-1.yaml @@ -22,11 +22,6 @@ metadata: api-version: "1.0.0" name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1 namespace: {{ .Release.Namespace }} - ownerReferences: - - apiVersion: dp.wso2.com/v1alpha1 - kind: API - name: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api - uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-api-uid uid: {{ template "apk-helm.resource.prefix" . }}-devportal-ds-scope-1-uid spec: names: From a8155abfc6d0b5ef5c3fd7e38ddc6f58cda965af Mon Sep 17 00:00:00 2001 From: chashikajw Date: Mon, 16 Oct 2023 11:08:34 +0530 Subject: [PATCH 7/7] Fix route issues in CRs --- .../templates/control-plane/admin-ds/admin-domain-api.yaml | 2 -- .../backoffice-ds/backoffice-domain-api-httproute-2.yaml | 2 +- .../control-plane/backoffice-ds/backoffice-domain-api.yaml | 1 + .../control-plane/devportal-ds/devportal-domain-api.yaml | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helm-charts/templates/control-plane/admin-ds/admin-domain-api.yaml b/helm-charts/templates/control-plane/admin-ds/admin-domain-api.yaml index 65e2c13ef..ea704186f 100644 --- a/helm-charts/templates/control-plane/admin-ds/admin-domain-api.yaml +++ b/helm-charts/templates/control-plane/admin-ds/admin-domain-api.yaml @@ -35,7 +35,5 @@ spec: - {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-2 - {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-3 - {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-4 - - {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-5 - - {{ template "apk-helm.resource.prefix" . }}-admin-ds-httproute-6 systemAPI: true {{- end -}} diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml index 6f1dde75a..7f3ef64d8 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api-httproute-2.yaml @@ -49,7 +49,7 @@ spec: - extensionRef: group: dp.wso2.com kind: Scope - name: 01ee6795-ce0f-1e46-820d-1176222ae290 + name: {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-scope-2 type: "ExtensionRef" matches: - method: "GET" diff --git a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api.yaml b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api.yaml index 1935e75e5..63d949994 100644 --- a/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api.yaml +++ b/helm-charts/templates/control-plane/backoffice-ds/backoffice-domain-api.yaml @@ -35,5 +35,6 @@ spec: - {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-1 - {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-2 - {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-3 + - {{ template "apk-helm.resource.prefix" . }}-backoffice-ds-httproute-4 systemAPI: true {{- end -}} diff --git a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api.yaml b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api.yaml index 7b9c994e3..e3eedfd25 100644 --- a/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api.yaml +++ b/helm-charts/templates/control-plane/devportal-ds/devportal-domain-api.yaml @@ -35,5 +35,6 @@ spec: - {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-3 - {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-4 - {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-5 + - {{ template "apk-helm.resource.prefix" . }}-devportal-ds-httproute-6 systemAPI: true {{- end -}}