diff --git a/adapter/internal/operator/config/crd/bases/dp.wso2.com_apis.yaml b/adapter/internal/operator/config/crd/bases/dp.wso2.com_apis.yaml index 0afaad5f8f..552612ff93 100644 --- a/adapter/internal/operator/config/crd/bases/dp.wso2.com_apis.yaml +++ b/adapter/internal/operator/config/crd/bases/dp.wso2.com_apis.yaml @@ -97,6 +97,7 @@ spec: type: string environment: description: Environment denotes the environment of the API. + nullable: true type: string isDefaultVersion: description: IsDefaultVersion indicates whether this API version should diff --git a/adapter/internal/operator/controllers/dp/tokenissuer_controller.go b/adapter/internal/operator/controllers/dp/tokenissuer_controller.go index 1a4ba09f76..bc60713ef1 100644 --- a/adapter/internal/operator/controllers/dp/tokenissuer_controller.go +++ b/adapter/internal/operator/controllers/dp/tokenissuer_controller.go @@ -263,12 +263,12 @@ func getResolvedClaimMapping(claimMappings []dpv1alpha1.ClaimMapping) map[string func getTokenIssuerEnvironments(environments []string) []string { - resolvedEnvirenvironments := []string{} + resolvedEnvironments := []string{} if len(environments) == 0 { - resolvedEnvirenvironments = append(resolvedEnvirenvironments, defaultAllEnvironments) + resolvedEnvironments = append(resolvedEnvironments, defaultAllEnvironments) } else { - resolvedEnvirenvironments = environments + resolvedEnvironments = environments } - return resolvedEnvirenvironments + return resolvedEnvironments } diff --git a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/ExtendedAPI.java b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/ExtendedAPI.java index 783288a547..8ab5c77aaf 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/ExtendedAPI.java +++ b/gateway/enforcer/org.wso2.apk.enforcer.commons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/ExtendedAPI.java @@ -41,7 +41,7 @@ public void setApiContext(String apiContext) { this.apiContext = apiContext; } - public String getEnvironment() { + public String getEnvironmentId() { return environmentId; } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIConstants.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIConstants.java index 9cdc764e2f..539d2dfc4a 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIConstants.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/constants/APIConstants.java @@ -46,7 +46,6 @@ public class APIConstants { public static final String API_KEY_TYPE_PRODUCTION = "PRODUCTION"; public static final String API_KEY_TYPE_SANDBOX = "SANDBOX"; public static final String DEFAULT_ENVIRONMENT_NAME = "Default"; - public static final String DEFAULT_ENVIRONMENT_ID = "Default-ID"; public static final String AUTHORIZATION_HEADER_BASIC = "Basic"; public static final String API_SECURITY_OAUTH2 = "oauth2"; diff --git a/helm-charts/README.md b/helm-charts/README.md index 2ab8056477..e7786dbbf5 100644 --- a/helm-charts/README.md +++ b/helm-charts/README.md @@ -40,7 +40,7 @@ A Helm chart for APK components | wso2.apk.idp.signing.secretName | string | `""` | IDP jwt signing certificate secret name | | wso2.apk.idp.signing.fileName | string | `""` | IDP jwt signing certificate file name | | wso2.apk.dp.enabled | bool | `true` | Enable the deployment of the Data Plane | -| wso2.apk.dp.environment | string | `Default` | Environment of the Data Plane | +| wso2.apk.dp.environment.name | string | `Default` | Environment of the Data Plane | | wso2.apk.dp.gateway.listener.hostname | string | `"gw.wso2.com"` | Gateway Listener Hostname | | wso2.apk.dp.gateway.listener.secretName | string | `""` | Gateway Listener Certificate Secret Name | | wso2.apk.dp.gateway.listener.dns | list | `["*.gw.wso2.com","*.sandbox.gw.wso2.com","prod.gw.wso2.com"]` | DNS entries for gateway listener certificate | diff --git a/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml b/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml index 7c2eaf8c39..64c9fe76b4 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-log-conf.yaml @@ -7,8 +7,8 @@ metadata: data: config.toml: | [commoncontroller] - {{- if .Values.wso2.apk.dp.environment }} - environment = "{{ .Values.wso2.apk.dp.environment }}" + {{- if and .Values.wso2.apk.dp.environment .Values.wso2.apk.dp.environment.name }} + environment = "{{ .Values.wso2.apk.dp.environment.name }}" {{- end }} [commoncontroller.server] label = "ratelimiter" diff --git a/helm-charts/templates/data-plane/gateway-components/log-conf.yaml b/helm-charts/templates/data-plane/gateway-components/log-conf.yaml index 9344b80225..50130ba183 100644 --- a/helm-charts/templates/data-plane/gateway-components/log-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/log-conf.yaml @@ -7,8 +7,8 @@ metadata: data: config.toml: | [adapter] - {{- if .Values.wso2.apk.dp.environment }} - environment = "{{ .Values.wso2.apk.dp.environment }}" + {{- if and .Values.wso2.apk.dp.environment .Values.wso2.apk.dp.environment.name }} + environment = "{{ .Values.wso2.apk.dp.environment.name }}" {{- end }} {{ if and .Values.wso2.apk.dp.adapter.configs .Values.wso2.apk.dp.adapter.configs.apiNamespaces }} [adapter.operator] diff --git a/helm-charts/values.yaml.template b/helm-charts/values.yaml.template index 454c50d60b..a02b6538c8 100644 --- a/helm-charts/values.yaml.template +++ b/helm-charts/values.yaml.template @@ -243,8 +243,9 @@ wso2: dp: # -- Enable the deployment of the Data Plane enabled: true - # -- Environment Name of the Data Plane - environment: "Development" + environment: + # -- Environment Name of the Data Plane + name: "Development" gateway: listener: # -- Gateway Listener Hostname