Skip to content

Commit

Permalink
Template cors config
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 committed Oct 28, 2024
1 parent 883e488 commit 080a191
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions helm-charts/templates/data-plane/gateway-components/log-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,24 @@ data:
{{end}}
{{end}}

{{ if and .Values.wso2.apk.dp.gatewayRuntime.deployment .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.cors }}
[enforcer.cors]
enabled = {{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.cors.enabled | default false }}
accessControlAllowOrigins = [{{ include "commaJoinedQuotedList" .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.cors.accessControlAllowOrigins }}]
accessControlAllowMethods = [{{ include "commaJoinedQuotedList" .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.cors.accessControlAllowMethods }}]
accessControlAllowHeaders = [{{ include "commaJoinedQuotedList" .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.cors.accessControlAllowHeaders }}]
accessControlAllowCredentials = {{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.cors.accessControlAllowCredentials | default false }}
accessControlExposeHeaders = [{{ include "commaJoinedQuotedList" .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.cors.accessControlExposeHeaders }}]
{{- else }}
[enforcer.cors]
enabled = true
accessControlAllowOrigins = ["*"]
accessControlAllowMethods = ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]
accessControlAllowHeaders = ["authorization", "Access-Control-Allow-Origin", "Content-Type", "Internal-key", "apiKey"]
accessControlAllowCredentials = false
accessControlExposeHeaders = ["*"]
{{end}}

[enforcer.jwtGenerator]
publicCertificatePath = "/home/wso2/security/truststore/mg.pem"
privateKeyPath = "/home/wso2/security/keystore/mg.key"
Expand Down

0 comments on commit 080a191

Please sign in to comment.