Skip to content

Commit

Permalink
Merge pull request #1817 from chashikajw/add-scopes-crs
Browse files Browse the repository at this point in the history
Add scopes CRs for control plane and revamp routes
  • Loading branch information
Krishanx92 authored Oct 18, 2023
2 parents 793ace8 + a8155ab commit dfd7de7
Show file tree
Hide file tree
Showing 36 changed files with 1,978 additions and 2,072 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,250 +25,191 @@ metadata:
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:
- 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:
replaceFullPath: "/deny-policies/\\1"
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:
- 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: "/api/admin/application-rate-plans"
method: "POST"
filters:
- type: "URLRewrite"
urlRewrite:
path:
type: "ReplaceFullPath"
replaceFullPath: "/api/admin/application-rate-plans"
backendRefs:
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/application-rate-plans/(.*)"
method: "GET"
weight: 1
filters:
- type: "URLRewrite"
urlRewrite:
path:
replaceFullPath: "/deny-policies/\\1"
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:
- 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: "/api/admin/application-rate-plans/(.*)"
method: "PUT"
filters:
- type: "URLRewrite"
urlRewrite:
path:
type: "ReplaceFullPath"
replaceFullPath: "/api/admin/application-rate-plans/\\1"
backendRefs:
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/application-rate-plans/(.*)"
method: "DELETE"
filters:
- type: "URLRewrite"
urlRewrite:
path:
replaceFullPath: "/deny-policies/\\1"
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:
- 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: "/api/admin/business-plans"
method: "GET"
filters:
- type: "URLRewrite"
urlRewrite:
path:
type: "ReplaceFullPath"
replaceFullPath: "/api/admin/business-plans"
backendRefs:
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/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:
- 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: "/api/admin/business-plans/(.*)"
method: "GET"
filters:
- type: "URLRewrite"
urlRewrite:
path:
type: "ReplaceFullPath"
replaceFullPath: "/api/admin/business-plans/\\1"
backendRefs:
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/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:
- 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: "/api/admin/business-plans/(.*)"
method: "DELETE"
filters:
- type: "URLRewrite"
urlRewrite:
path:
type: "ReplaceFullPath"
replaceFullPath: "/api/admin/business-plans/\\1"
backendRefs:
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:
replaceFullPath: "/applications/\\1"
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:
- 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: "/api/admin/throttling/policies/advanced"
method: "POST"
filters:
- type: "URLRewrite"
urlRewrite:
path:
type: "ReplaceFullPath"
replaceFullPath: "/api/admin/throttling/policies/advanced"
backendRefs:
value: "/applications/(.*)"
- 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:
replaceFullPath: "/applications/\\1"
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:
- 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: "/api/admin/throttling/policies/advanced/(.*)"
method: "PUT"
filters:
- type: "URLRewrite"
urlRewrite:
path:
type: "ReplaceFullPath"
replaceFullPath: "/api/admin/throttling/policies/advanced/\\1"
backendRefs:
value: "/applications/(.*)"
- 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"
- 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 -}}
Loading

0 comments on commit dfd7de7

Please sign in to comment.