From 1159e99444b62f311e0d785f8818a96279553edb Mon Sep 17 00:00:00 2001 From: tharindu1st Date: Thu, 9 Nov 2023 18:55:55 +0530 Subject: [PATCH 1/4] initial code for rest server --- common-controller/cmd/main.go | 6 +- .../internal/config/default_config.go | 3 +- common-controller/internal/config/types.go | 35 +++++----- .../apis/cp/v1alpha2/application_types.go | 1 + .../crd/bases/cp.wso2.com_applications.yaml | 3 + .../controllers/cp/application_controller.go | 40 +++++------ .../cp/applicationmapping_controller.go | 17 +++-- .../controllers/cp/subscription_controller.go | 21 +++--- .../server/application_key_mapping.go | 15 ++++ .../server/application_mapping_types.go | 30 ++++++++ .../internal/server/application_types.go | 32 +++++++++ common-controller/internal/server/server.go | 70 +++++++++++++++++++ .../internal/server/subscription_types.go | 43 ++++++++++++ .../crds/cp.wso2.com_applications.yaml | 3 + .../common-controller-deployment.yaml | 2 + .../common-controller-service.yaml | 3 + 16 files changed, 263 insertions(+), 61 deletions(-) create mode 100644 common-controller/internal/server/application_key_mapping.go create mode 100644 common-controller/internal/server/application_mapping_types.go create mode 100644 common-controller/internal/server/application_types.go create mode 100644 common-controller/internal/server/server.go create mode 100644 common-controller/internal/server/subscription_types.go diff --git a/common-controller/cmd/main.go b/common-controller/cmd/main.go index c116218f4..3a8dcfb26 100644 --- a/common-controller/cmd/main.go +++ b/common-controller/cmd/main.go @@ -20,14 +20,16 @@ package main import ( logger "github.com/sirupsen/logrus" commoncontroller "github.com/wso2/apk/common-controller/commoncontroller" - web "github.com/wso2/apk/common-controller/internal/web" config "github.com/wso2/apk/common-controller/internal/config" + "github.com/wso2/apk/common-controller/internal/server" + web "github.com/wso2/apk/common-controller/internal/web" ) func main() { conf := config.ReadConfigs() logger.Info("Starting the Web server") - go web.StartWebServer(); + go web.StartWebServer() + go server.StartInternalServer() logger.Info("Starting the Common Controller") commoncontroller.InitCommonControllerServer(conf) } diff --git a/common-controller/internal/config/default_config.go b/common-controller/internal/config/default_config.go index 58bf768ea..ce4456b00 100644 --- a/common-controller/internal/config/default_config.go +++ b/common-controller/internal/config/default_config.go @@ -33,6 +33,7 @@ var defaultConfig = &Config{ Truststore: truststore{ Location: "/home/wso2/security/truststore", }, - Environment: "Default", + Environment: "Default", + InternalAPIServer: internalAPIServer{Port: 18003}, }, } diff --git a/common-controller/internal/config/types.go b/common-controller/internal/config/types.go index acf9f2ee9..58ae1161d 100644 --- a/common-controller/internal/config/types.go +++ b/common-controller/internal/config/types.go @@ -39,13 +39,16 @@ type commoncontroller struct { Server server Operator operator // Trusted Certificates - Truststore truststore - Environment string - Redis redis - Sts sts - WebServer webServer + Truststore truststore + Environment string + Redis redis + Sts sts + WebServer webServer + InternalAPIServer internalAPIServer +} +type internalAPIServer struct { + Port int64 } - type keystore struct { KeyPath string CertPath string @@ -64,19 +67,19 @@ type operator struct { } type redis struct { - Host string - Port string - Username string - Password string - UserCertPath string - UserKeyPath string - CACertPath string - TLSEnabled bool - RevokedTokenChannel string + Host string + Port string + Username string + Password string + UserCertPath string + UserKeyPath string + CACertPath string + TLSEnabled bool + RevokedTokenChannel string } type sts struct { - AuthKeyPath string + AuthKeyPath string AuthKeyHeader string } diff --git a/common-controller/internal/operator/apis/cp/v1alpha2/application_types.go b/common-controller/internal/operator/apis/cp/v1alpha2/application_types.go index 39ffbad41..e1110737c 100644 --- a/common-controller/internal/operator/apis/cp/v1alpha2/application_types.go +++ b/common-controller/internal/operator/apis/cp/v1alpha2/application_types.go @@ -28,6 +28,7 @@ import ( type ApplicationSpec struct { Name string `json:"name"` Owner string `json:"owner"` + Organization string `json:"organization"` Attributes map[string]string `json:"attributes,omitempty"` SecuritySchemes SecuritySchemes `json:"securitySchemes"` } diff --git a/common-controller/internal/operator/config/crd/bases/cp.wso2.com_applications.yaml b/common-controller/internal/operator/config/crd/bases/cp.wso2.com_applications.yaml index 49df1f41c..63c1772c9 100644 --- a/common-controller/internal/operator/config/crd/bases/cp.wso2.com_applications.yaml +++ b/common-controller/internal/operator/config/crd/bases/cp.wso2.com_applications.yaml @@ -40,6 +40,8 @@ spec: type: object name: type: string + organization: + type: string owner: type: string securitySchemes: @@ -69,6 +71,7 @@ spec: type: object required: - name + - organization - owner - securitySchemes type: object diff --git a/common-controller/internal/operator/controllers/cp/application_controller.go b/common-controller/internal/operator/controllers/cp/application_controller.go index 78e717097..3a6756df8 100644 --- a/common-controller/internal/operator/controllers/cp/application_controller.go +++ b/common-controller/internal/operator/controllers/cp/application_controller.go @@ -23,7 +23,10 @@ import ( "github.com/wso2/apk/adapter/pkg/logging" "github.com/wso2/apk/common-controller/internal/loggers" - "github.com/wso2/apk/common-controller/internal/xds" + cpv1alpha2 "github.com/wso2/apk/common-controller/internal/operator/apis/cp/v1alpha2" + constants "github.com/wso2/apk/common-controller/internal/operator/constant" + "github.com/wso2/apk/common-controller/internal/server" + "github.com/wso2/apk/common-controller/internal/utils" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -34,11 +37,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" - cpv1alpha2 "github.com/wso2/apk/common-controller/internal/operator/apis/cp/v1alpha2" - "github.com/wso2/apk/common-controller/internal/operator/constant" - "github.com/wso2/apk/common-controller/internal/utils" ) // ApplicationReconciler reconciles a Application object @@ -98,35 +96,35 @@ func (applicationReconciler *ApplicationReconciler) Reconcile(ctx context.Contex func sendAppUpdates(applicationList *cpv1alpha2.ApplicationList) { appList := marshalApplicationList(applicationList.Items) - xds.UpdateEnforcerApplications(appList) - + server.AddApplication(appList) appKeyMappingList := marshalApplicationKeyMapping(applicationList.Items) - xds.UpdateEnforcerApplicationKeyMappings(appKeyMappingList) + server.AddApplicationKeyMapping(appKeyMappingList) } -func marshalApplicationList(applicationList []cpv1alpha2.Application) *subscription.ApplicationList { - applications := []*subscription.Application{} +func marshalApplicationList(applicationList []cpv1alpha2.Application) *server.ApplicationList { + applications := []server.Application{} for _, appInternal := range applicationList { - app := &subscription.Application{ - Uuid: appInternal.Name, - Name: appInternal.Spec.Name, - Owner: appInternal.Spec.Owner, - Attributes: appInternal.Spec.Attributes, + app := server.Application{ + UUID: appInternal.Name, + Name: appInternal.Spec.Name, + Owner: appInternal.Spec.Owner, + OrganizationID: appInternal.Spec.Organization, + Attributes: appInternal.Spec.Attributes, } applications = append(applications, app) } - return &subscription.ApplicationList{ + return &server.ApplicationList{ List: applications, } } -func marshalApplicationKeyMapping(applicationList []cpv1alpha2.Application) *subscription.ApplicationKeyMappingList { - applicationKeyMappings := []*subscription.ApplicationKeyMapping{} +func marshalApplicationKeyMapping(applicationList []cpv1alpha2.Application) server.ApplicationKeyMappingList { + applicationKeyMappings := []server.ApplicationKeyMapping{} for _, appInternal := range applicationList { var oauth2SecurityScheme = appInternal.Spec.SecuritySchemes.OAuth2 if oauth2SecurityScheme != nil { for _, env := range oauth2SecurityScheme.Environments { - appIdentifier := &subscription.ApplicationKeyMapping{ + appIdentifier := server.ApplicationKeyMapping{ ApplicationUUID: appInternal.Name, SecurityScheme: constants.OAuth2, ApplicationIdentifier: env.AppID, @@ -137,7 +135,7 @@ func marshalApplicationKeyMapping(applicationList []cpv1alpha2.Application) *sub } } } - return &subscription.ApplicationKeyMappingList{ + return server.ApplicationKeyMappingList{ List: applicationKeyMappings, } } diff --git a/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go b/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go index 4569253e0..b450013c0 100644 --- a/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go +++ b/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go @@ -23,7 +23,7 @@ import ( "github.com/wso2/apk/adapter/pkg/logging" "github.com/wso2/apk/common-controller/internal/loggers" - "github.com/wso2/apk/common-controller/internal/xds" + "github.com/wso2/apk/common-controller/internal/server" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -35,9 +35,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" cpv1alpha2 "github.com/wso2/apk/common-controller/internal/operator/apis/cp/v1alpha2" - "github.com/wso2/apk/common-controller/internal/operator/constant" + constants "github.com/wso2/apk/common-controller/internal/operator/constant" "github.com/wso2/apk/common-controller/internal/utils" ) @@ -98,20 +97,20 @@ func (r *ApplicationMappingReconciler) Reconcile(ctx context.Context, req ctrl.R func sendUpdates(applicationMappingList *cpv1alpha2.ApplicationMappingList) { appMappingList := marshalApplicationMappingList(applicationMappingList.Items) - xds.UpdateEnforcerApplicationMappings(appMappingList) + server.AddApplicationMapping(appMappingList) } -func marshalApplicationMappingList(applicationMappingList []cpv1alpha2.ApplicationMapping) *subscription.ApplicationMappingList { - applicationMappings := []*subscription.ApplicationMapping{} +func marshalApplicationMappingList(applicationMappingList []cpv1alpha2.ApplicationMapping) server.ApplicationMappingList { + applicationMappings := []server.ApplicationMapping{} for _, appMappingInternal := range applicationMappingList { - appMapping := &subscription.ApplicationMapping{ - Uuid: appMappingInternal.Name, + appMapping := server.ApplicationMapping{ + UUID: appMappingInternal.Name, ApplicationRef: appMappingInternal.Spec.ApplicationRef, SubscriptionRef: appMappingInternal.Spec.SubscriptionRef, } applicationMappings = append(applicationMappings, appMapping) } - return &subscription.ApplicationMappingList{ + return server.ApplicationMappingList{ List: applicationMappings, } } diff --git a/common-controller/internal/operator/controllers/cp/subscription_controller.go b/common-controller/internal/operator/controllers/cp/subscription_controller.go index 0395c3cfd..c7714ef2a 100644 --- a/common-controller/internal/operator/controllers/cp/subscription_controller.go +++ b/common-controller/internal/operator/controllers/cp/subscription_controller.go @@ -21,12 +21,11 @@ import ( "context" "fmt" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" "github.com/wso2/apk/adapter/pkg/logging" loggers "github.com/wso2/apk/common-controller/internal/loggers" constants "github.com/wso2/apk/common-controller/internal/operator/constant" + "github.com/wso2/apk/common-controller/internal/server" "github.com/wso2/apk/common-controller/internal/utils" - xds "github.com/wso2/apk/common-controller/internal/xds" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -98,15 +97,15 @@ func (subscriptionReconciler *SubscriptionReconciler) Reconcile(ctx context.Cont func sendSubUpdates(subscriptionsList *cpv1alpha2.SubscriptionList) { subList := marshalSubscriptionList(subscriptionsList.Items) - xds.UpdateEnforcerSubscriptions(subList) + server.AddSubscription(subList) } -func marshalSubscriptionList(subscriptionList []cpv1alpha2.Subscription) *subscription.SubscriptionList { - subscriptions := []*subscription.Subscription{} +func marshalSubscriptionList(subscriptionList []cpv1alpha2.Subscription) *server.SubscriptionList { + subscriptions := []server.Subscription{} for _, subInternal := range subscriptionList { - subscribedAPI := &subscription.SubscribedAPI{} - sub := &subscription.Subscription{ - Uuid: subInternal.Name, + subscribedAPI := &server.SubscribedAPI{} + sub := server.Subscription{ + UUID: subInternal.Name, SubStatus: subInternal.Spec.SubscriptionStatus, Organization: subInternal.Spec.Organization, } @@ -114,10 +113,8 @@ func marshalSubscriptionList(subscriptionList []cpv1alpha2.Subscription) *subscr subscribedAPI.Name = subInternal.Spec.API.Name subscribedAPI.Version = subInternal.Spec.API.Version } - sub.SubscribedApi = subscribedAPI + sub.SubscribedAPI = subscribedAPI subscriptions = append(subscriptions, sub) } - return &subscription.SubscriptionList{ - List: subscriptions, - } + return &server.SubscriptionList{List: subscriptions} } diff --git a/common-controller/internal/server/application_key_mapping.go b/common-controller/internal/server/application_key_mapping.go new file mode 100644 index 000000000..998d76d55 --- /dev/null +++ b/common-controller/internal/server/application_key_mapping.go @@ -0,0 +1,15 @@ +package server + +// ApplicationKeyMapping defines the desired state of ApplicationKeyMapping +type ApplicationKeyMapping struct { + ApplicationUUID string `json:"applicationUUID,omitempty"` + SecurityScheme string `json:"securityScheme,omitempty"` + ApplicationIdentifier string `json:"applicationIdentifier,omitempty"` + KeyType string `json:"keyType,omitempty"` + EnvID string `json:"envID,omitempty"` +} + +// ApplicationKeyMappingList contains a list of ApplicationKeyMapping +type ApplicationKeyMappingList struct { + List []ApplicationKeyMapping `json:"list"` +} diff --git a/common-controller/internal/server/application_mapping_types.go b/common-controller/internal/server/application_mapping_types.go new file mode 100644 index 000000000..34155b4e8 --- /dev/null +++ b/common-controller/internal/server/application_mapping_types.go @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * Licensed 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. + * + */ + +package server + +// ApplicationMapping defines the desired state of ApplicationMapping +type ApplicationMapping struct { + UUID string `json:"uuid"` + ApplicationRef string `json:"applicationRef"` + SubscriptionRef string `json:"subscriptionRef"` +} + +// ApplicationMappingList contains a list of ApplicationMapping +type ApplicationMappingList struct { + List []ApplicationMapping `json:"list"` +} diff --git a/common-controller/internal/server/application_types.go b/common-controller/internal/server/application_types.go new file mode 100644 index 000000000..01ad4613b --- /dev/null +++ b/common-controller/internal/server/application_types.go @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * Licensed 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. + * + */ + +package server + +// Application defines the desired state of Application +type Application struct { + UUID string `json:"uuid"` + Name string `json:"name"` + Owner string `json:"owner"` + Attributes map[string]string `json:"attributes,omitempty"` + OrganizationID string `json:"organizationId"` +} + +// ApplicationList contains a list of Application +type ApplicationList struct { + List []Application `json:"list"` +} diff --git a/common-controller/internal/server/server.go b/common-controller/internal/server/server.go new file mode 100644 index 000000000..f453d6732 --- /dev/null +++ b/common-controller/internal/server/server.go @@ -0,0 +1,70 @@ +package server + +import ( + "fmt" + "net/http" + + "github.com/gin-gonic/gin" + "github.com/wso2/apk/common-controller/internal/config" +) + +var applicationList *ApplicationList +var subscriptionList *SubscriptionList +var applicationMappingList *ApplicationMappingList +var applicationKeyMappingList *ApplicationKeyMappingList + +// StartInternalServer starts the internal server +func StartInternalServer() { + r := gin.Default() + + r.GET("/applications", func(c *gin.Context) { + if applicationList == nil { + c.JSON(http.StatusOK, ApplicationList{List: make([]Application, 0)}) + } + c.JSON(http.StatusOK, applicationList) + }) + r.GET("/subscriptions", func(c *gin.Context) { + if subscriptionList == nil { + c.JSON(http.StatusOK, SubscriptionList{List: make([]Subscription, 0)}) + } + c.JSON(http.StatusOK, subscriptionList) + }) + r.GET("/applicationmappings", func(c *gin.Context) { + if applicationMappingList == nil { + c.JSON(http.StatusOK, ApplicationMappingList{List: make([]ApplicationMapping, 0)}) + } + c.JSON(http.StatusOK, applicationMappingList) + }) + r.GET("/applicationkeymappings", func(c *gin.Context) { + if applicationKeyMappingList == nil { + c.JSON(http.StatusOK, ApplicationKeyMappingList{List: make([]ApplicationKeyMapping, 0)}) + } + c.JSON(http.StatusOK, applicationKeyMappingList) + }) + gin.SetMode(gin.ReleaseMode) + conf := config.ReadConfigs() + certPath := conf.CommonController.Keystore.CertPath + keyPath := conf.CommonController.Keystore.KeyPath + port := conf.CommonController.InternalAPIServer.Port + r.RunTLS(fmt.Sprintf(":%d", port), certPath, keyPath) +} + +// AddApplication adds an application to the application list +func AddApplication(appList *ApplicationList) { + applicationList = appList +} + +// AddSubscription adds a subscription to the subscription list +func AddSubscription(subList *SubscriptionList) { + subscriptionList = subList +} + +// AddApplicationMapping adds an application mapping to the application mapping list +func AddApplicationMapping(appMappingList ApplicationMappingList) { + applicationMappingList = &appMappingList +} + +// AddApplicationKeyMapping adds an application key mapping to the application key mapping list +func AddApplicationKeyMapping(appKeyMappingList ApplicationKeyMappingList) { + applicationKeyMappingList = &appKeyMappingList +} diff --git a/common-controller/internal/server/subscription_types.go b/common-controller/internal/server/subscription_types.go new file mode 100644 index 000000000..43f601a18 --- /dev/null +++ b/common-controller/internal/server/subscription_types.go @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * Licensed 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. + * + */ + +package server + +// Subscription defines the desired state of Subscription +type Subscription struct { + SubStatus string `json:"subStatus,omitempty"` + UUID string `json:"uuid,omitempty"` + Organization string `json:"organization,omitempty"` + SubscribedAPI *SubscribedAPI `json:"subscribedApi,omitempty"` +} + +// API defines the API associated with the subscription +type API struct { + Name string `json:"name"` + Version string `json:"version"` +} + +// SubscriptionList contains a list of Subscription +type SubscriptionList struct { + List []Subscription `json:"list"` +} + +// SubscribedAPI defines the API associated with the subscription +type SubscribedAPI struct { + Name string `json:"name,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/helm-charts/crds/cp.wso2.com_applications.yaml b/helm-charts/crds/cp.wso2.com_applications.yaml index 49df1f41c..63c1772c9 100644 --- a/helm-charts/crds/cp.wso2.com_applications.yaml +++ b/helm-charts/crds/cp.wso2.com_applications.yaml @@ -40,6 +40,8 @@ spec: type: object name: type: string + organization: + type: string owner: type: string securitySchemes: @@ -69,6 +71,7 @@ spec: type: object required: - name + - organization - owner - securitySchemes type: object diff --git a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml index 0db6a5e41..5a2647ca0 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml @@ -46,6 +46,8 @@ spec: protocol: TCP - containerPort: 9543 protocol: TCP + - containerPort: 18003 + protocol: TCP {{ include "apk-helm.deployment.resources" .Values.wso2.apk.dp.commonController.deployment.resources | indent 10 }} {{ include "apk-helm.deployment.env" .Values.wso2.apk.dp.commonController.deployment.env | indent 10 }} - name: OPERATOR_POD_NAMESPACE diff --git a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-service.yaml b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-service.yaml index 4877adc43..e5adf645f 100644 --- a/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-service.yaml +++ b/helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-service.yaml @@ -35,4 +35,7 @@ spec: protocol: TCP port: 443 targetPort: 9443 + - name: https-internal-api + protocol: TCP + port: 18003 {{- end -}} From e1ad761abcc1f7adac0a1eefeac908c6eef87786 Mon Sep 17 00:00:00 2001 From: tharindu1st Date: Mon, 13 Nov 2023 18:12:26 +0530 Subject: [PATCH 2/4] add rest server initial fill changes --- .../controllers/cp/application_controller.go | 4 +- .../controllers/cp/subscription_controller.go | 4 +- common-controller/internal/server/server.go | 28 +-- .../org.wso2.apk.enforcer/build.gradle | 7 + .../apk/enforcer/config/ConfigHolder.java | 30 +++ .../apk/enforcer/config/EnvVarConfig.java | 12 + .../discovery/ApplicationDiscoveryClient.java | 204 --------------- .../ApplicationKeyMappingDiscoveryClient.java | 204 --------------- .../ApplicationMappingDiscoveryClient.java | 204 --------------- .../ApplicationPolicyDiscoveryClient.java | 204 --------------- .../SubscriptionDiscoveryClient.java | 204 --------------- .../SubscriptionPolicyDiscoveryClient.java | 203 --------------- .../scheduler/XdsSchedulerManager.java | 105 +------- .../enforcer/interceptor/opa/OPAClient.java | 4 +- .../enforcer/subscription/ApplicationDto.java | 70 ++++++ .../ApplicationKeyMappingDTO.java | 63 +++++ .../ApplicationKeyMappingDtoList.java | 13 + .../subscription/ApplicationListDto.java | 19 ++ .../subscription/ApplicationMappingDto.java | 40 +++ .../ApplicationMappingDtoList.java | 13 + .../subscription/SubscribedAPIDto.java | 29 +++ .../subscription/SubscriptionDataStore.java | 12 +- .../SubscriptionDataStoreImpl.java | 163 ++++++------ .../subscription/SubscriptionDto.java | 55 ++++ .../subscription/SubscriptionListDto.java | 14 ++ ...tionValidationDataRetrievalRestClient.java | 23 ++ .../enforcer/util/ApacheFeignHttpClient.java | 238 ++++++++++++++++++ .../wso2/apk/enforcer/util/FilterUtils.java | 137 +++++----- .../gateway-runtime-deployment.yaml | 10 + 29 files changed, 810 insertions(+), 1506 deletions(-) delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationDiscoveryClient.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationKeyMappingDiscoveryClient.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationMappingDiscoveryClient.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationPolicyDiscoveryClient.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/SubscriptionDiscoveryClient.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/SubscriptionPolicyDiscoveryClient.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationDto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDTO.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDtoList.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationListDto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDtoList.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscribedAPIDto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionListDto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionValidationDataRetrievalRestClient.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/ApacheFeignHttpClient.java diff --git a/common-controller/internal/operator/controllers/cp/application_controller.go b/common-controller/internal/operator/controllers/cp/application_controller.go index 3a6756df8..b5c49d730 100644 --- a/common-controller/internal/operator/controllers/cp/application_controller.go +++ b/common-controller/internal/operator/controllers/cp/application_controller.go @@ -101,7 +101,7 @@ func sendAppUpdates(applicationList *cpv1alpha2.ApplicationList) { server.AddApplicationKeyMapping(appKeyMappingList) } -func marshalApplicationList(applicationList []cpv1alpha2.Application) *server.ApplicationList { +func marshalApplicationList(applicationList []cpv1alpha2.Application) server.ApplicationList { applications := []server.Application{} for _, appInternal := range applicationList { app := server.Application{ @@ -113,7 +113,7 @@ func marshalApplicationList(applicationList []cpv1alpha2.Application) *server.Ap } applications = append(applications, app) } - return &server.ApplicationList{ + return server.ApplicationList{ List: applications, } } diff --git a/common-controller/internal/operator/controllers/cp/subscription_controller.go b/common-controller/internal/operator/controllers/cp/subscription_controller.go index c7714ef2a..13aaeaf8f 100644 --- a/common-controller/internal/operator/controllers/cp/subscription_controller.go +++ b/common-controller/internal/operator/controllers/cp/subscription_controller.go @@ -100,7 +100,7 @@ func sendSubUpdates(subscriptionsList *cpv1alpha2.SubscriptionList) { server.AddSubscription(subList) } -func marshalSubscriptionList(subscriptionList []cpv1alpha2.Subscription) *server.SubscriptionList { +func marshalSubscriptionList(subscriptionList []cpv1alpha2.Subscription) server.SubscriptionList { subscriptions := []server.Subscription{} for _, subInternal := range subscriptionList { subscribedAPI := &server.SubscribedAPI{} @@ -116,5 +116,5 @@ func marshalSubscriptionList(subscriptionList []cpv1alpha2.Subscription) *server sub.SubscribedAPI = subscribedAPI subscriptions = append(subscriptions, sub) } - return &server.SubscriptionList{List: subscriptions} + return server.SubscriptionList{List: subscriptions} } diff --git a/common-controller/internal/server/server.go b/common-controller/internal/server/server.go index f453d6732..c48081102 100644 --- a/common-controller/internal/server/server.go +++ b/common-controller/internal/server/server.go @@ -8,37 +8,25 @@ import ( "github.com/wso2/apk/common-controller/internal/config" ) -var applicationList *ApplicationList -var subscriptionList *SubscriptionList -var applicationMappingList *ApplicationMappingList -var applicationKeyMappingList *ApplicationKeyMappingList +var applicationList = ApplicationList{List: []Application{}} +var subscriptionList = SubscriptionList{List: []Subscription{}} +var applicationMappingList = ApplicationMappingList{List: []ApplicationMapping{}} +var applicationKeyMappingList = ApplicationKeyMappingList{List: []ApplicationKeyMapping{}} // StartInternalServer starts the internal server func StartInternalServer() { r := gin.Default() r.GET("/applications", func(c *gin.Context) { - if applicationList == nil { - c.JSON(http.StatusOK, ApplicationList{List: make([]Application, 0)}) - } c.JSON(http.StatusOK, applicationList) }) r.GET("/subscriptions", func(c *gin.Context) { - if subscriptionList == nil { - c.JSON(http.StatusOK, SubscriptionList{List: make([]Subscription, 0)}) - } c.JSON(http.StatusOK, subscriptionList) }) r.GET("/applicationmappings", func(c *gin.Context) { - if applicationMappingList == nil { - c.JSON(http.StatusOK, ApplicationMappingList{List: make([]ApplicationMapping, 0)}) - } c.JSON(http.StatusOK, applicationMappingList) }) r.GET("/applicationkeymappings", func(c *gin.Context) { - if applicationKeyMappingList == nil { - c.JSON(http.StatusOK, ApplicationKeyMappingList{List: make([]ApplicationKeyMapping, 0)}) - } c.JSON(http.StatusOK, applicationKeyMappingList) }) gin.SetMode(gin.ReleaseMode) @@ -50,21 +38,21 @@ func StartInternalServer() { } // AddApplication adds an application to the application list -func AddApplication(appList *ApplicationList) { +func AddApplication(appList ApplicationList) { applicationList = appList } // AddSubscription adds a subscription to the subscription list -func AddSubscription(subList *SubscriptionList) { +func AddSubscription(subList SubscriptionList) { subscriptionList = subList } // AddApplicationMapping adds an application mapping to the application mapping list func AddApplicationMapping(appMappingList ApplicationMappingList) { - applicationMappingList = &appMappingList + applicationMappingList = appMappingList } // AddApplicationKeyMapping adds an application key mapping to the application key mapping list func AddApplicationKeyMapping(appKeyMappingList ApplicationKeyMappingList) { - applicationKeyMappingList = &appKeyMappingList + applicationKeyMappingList = appKeyMappingList } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/build.gradle b/gateway/enforcer/org.wso2.apk.enforcer/build.gradle index 36e56a3e3..e2eb59909 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/build.gradle +++ b/gateway/enforcer/org.wso2.apk.enforcer/build.gradle @@ -81,6 +81,13 @@ dependencies { implementation libs.reactor.netty.http implementation libs.protobuf.java implementation libs.jedis + implementation libs.feign.httpclient + implementation libs.gson + implementation libs.ua.parser + implementation libs.commons.lang3 + implementation libs.openfeign.feign.gson + implementation libs.openfeign.feign.slf4j + test { implementation libs.junit implementation libs.mockito.inline diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java index 695c3994f..dbe7de432 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java @@ -66,9 +66,11 @@ import java.io.IOException; import java.lang.reflect.Field; +import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; +import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.security.interfaces.RSAPublicKey; @@ -91,6 +93,8 @@ public class ConfigHolder { private static ConfigHolder configHolder; private final EnvVarConfig envVarConfig = EnvVarConfig.getInstance(); EnforcerConfig config = new EnforcerConfig(); + + private KeyStore keyStore = null; private KeyStore trustStore = null; private KeyStore trustStoreForJWT = null; private KeyStore opaKeyStore = null; @@ -101,6 +105,22 @@ private ConfigHolder() { loadTrustStore(); loadOpaClientKeyStore(); + loadKeyStore(); + } + + private void loadKeyStore() { + + try { + Certificate cert = + TLSUtils.getCertificateFromFile(getEnvVarConfig().getEnforcerPublicKeyPath()); + Key key = JWTUtils.getPrivateKey(getEnvVarConfig().getEnforcerPrivateKeyPath()); + keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, null); + keyStore.setKeyEntry("client-keys", key, null, new Certificate[]{cert}); + } catch (EnforcerException | CertificateException | IOException | KeyStoreException | + NoSuchAlgorithmException e) { + logger.error("Error occurred while configuring KeyStore", e); + } } public static ConfigHolder getInstance() { @@ -302,6 +322,16 @@ private void populateJWTGeneratorConfigurations(JWTGenerator jwtGenerator) { populateBackendJWKSConfiguration(jwtGenerator); } + public KeyStore getKeyStore() { + + return keyStore; + } + + public void setKeyStore(KeyStore keyStore) { + + this.keyStore = keyStore; + } + private void populateBackendJWKSConfiguration(JWTGenerator jwtGenerator) { BackendJWKSDto backendJWKSDto = new BackendJWKSDto(); diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnvVarConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnvVarConfig.java index 1a3ac0877..1d4367285 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnvVarConfig.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnvVarConfig.java @@ -37,6 +37,8 @@ public class EnvVarConfig { private static final String ADAPTER_XDS_PORT = "ADAPTER_XDS_PORT"; private static final String COMMON_CONTROLLER_HOST = "COMMON_CONTROLLER_HOST"; private static final String COMMON_CONTROLLER_XDS_PORT = "COMMON_CONTROLLER_XDS_PORT"; + private static final String COMMON_CONTROLLER_REST_PORT = "COMMON_CONTROLLER_REST_PORT"; + private static final String ENFORCER_LABEL = "ENFORCER_LABEL"; private static final String ENFORCER_REGION_ID = "ENFORCER_REGION"; public static final String XDS_MAX_MSG_SIZE = "XDS_MAX_MSG_SIZE"; @@ -67,6 +69,7 @@ public class EnvVarConfig { private static final String DEFAULT_ADAPTER_XDS_PORT = "18000"; private static final String DEFAULT_COMMON_CONTROLLER_HOST = "common-controller"; private static final String DEFAULT_COMMON_CONTROLLER_XDS_PORT = "18002"; + private static final String DEFAULT_COMMON_CONTROLLER_REST_PORT = "18003"; private static final String DEFAULT_ENFORCER_LABEL = "enforcer"; public static final String DEFAULT_XDS_MAX_MSG_SIZE = "4194304"; public static final String DEFAULT_XDS_MAX_RETRIES = Integer.toString(Constants.MAX_XDS_RETRIES); @@ -94,6 +97,7 @@ public class EnvVarConfig { private final String enforcerLabel; private final String adapterXdsPort; private final String commonControllerXdsPort; + private final String commonControllerRestPort; private final String adapterHostname; private final String commonControllerHostname; // TODO: (VirajSalaka) Enforcer ID should be picked from router once envoy 1.18.0 is released and microgateway @@ -136,6 +140,8 @@ private EnvVarConfig() { DEFAULT_COMMON_CONTROLLER_HOST_NAME); commonControllerXdsPort = retrieveEnvVarOrDefault(COMMON_CONTROLLER_XDS_PORT, DEFAULT_COMMON_CONTROLLER_XDS_PORT); + commonControllerRestPort = retrieveEnvVarOrDefault(COMMON_CONTROLLER_REST_PORT, + DEFAULT_COMMON_CONTROLLER_REST_PORT); xdsMaxMsgSize = retrieveEnvVarOrDefault(XDS_MAX_MSG_SIZE, DEFAULT_XDS_MAX_MSG_SIZE); enforcerRegionId = retrieveEnvVarOrDefault(ENFORCER_REGION_ID, DEFAULT_ENFORCER_REGION_ID); xdsMaxRetries = retrieveEnvVarOrDefault(XDS_MAX_RETRIES, DEFAULT_XDS_MAX_RETRIES); @@ -308,4 +314,10 @@ public String getRevokedTokensRedisChannel() { public int getRevokedTokenCleanupInterval() { return revokedTokenCleanupInterval; } + + public String getCommonControllerRestPort() { + + return commonControllerRestPort; + } } + diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationDiscoveryClient.java deleted file mode 100644 index c119742ca..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationDiscoveryClient.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.service.subscription.ApplicationDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.discovery.subscription.Application; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationList; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreImpl; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with Application discovery service at the common-controller. - */ -public class ApplicationDiscoveryClient implements Runnable { - private static final Logger logger = LogManager.getLogger(ApplicationDiscoveryClient.class); - private static ApplicationDiscoveryClient instance; - private ManagedChannel channel; - private ApplicationDiscoveryServiceGrpc.ApplicationDiscoveryServiceStub stub; - private StreamObserver reqObserver; - private final SubscriptionDataStoreImpl subscriptionDataStore; - private final String host; - private final String hostname; - private final int port; - - /** - * This is a reference to the latest received response from the ADS. - *

- * Usage: When ack/nack a DiscoveryResponse this value is used to identify the latest received DiscoveryResponse - * which may not have been acked/nacked so far. - *

- */ - - private DiscoveryResponse latestReceived; - /** - * This is a reference to the latest acked response from the ADS. - *

- * Usage: When nack a DiscoveryResponse this value is used to find the latest successfully processed - * DiscoveryResponse. Information sent in the nack request will contain information about this response value. - *

- */ - private DiscoveryResponse latestACKed; - - /** - * Node struct for the discovery client - */ - private final Node node; - - private ApplicationDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.subscriptionDataStore = SubscriptionDataStoreImpl.getInstance(); - initConnection(); - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("Application discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - this.stub = ApplicationDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopApplicationDiscoveryScheduling(); - } - } - - public static ApplicationDiscoveryClient getInstance() { - if (instance == null) { - String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); - String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); - int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerXdsPort()); - instance = new ApplicationDiscoveryClient(sdsHost, sdsHostname, sdsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchApplications(); - } - - public void watchApplications() { - // TODO: (Praminda) implement a deadline with retries - reqObserver = stub.streamApplications(new StreamObserver() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("Application creation event received with version : " + response.getVersionInfo()); - logger.debug("Received Application discovery response " + response); - XdsSchedulerManager.getInstance().stopApplicationDiscoveryScheduling(); - latestReceived = response; - try { - List applicationList = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - applicationList.addAll(res.unpack(ApplicationList.class).getListList()); - } - subscriptionDataStore.addApplications(applicationList); - logger.info("Number of applications received : " + applicationList.size()); - ack(); - } catch (Exception e) { - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during Application discovery", throwable); - XdsSchedulerManager.getInstance().startApplicationDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving Application data"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.APPLICATION_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.APPLICATION_LIST_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in Application discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. This is part of the xDS - * communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.APPLICATION_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.APPLICATION_LIST_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationKeyMappingDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationKeyMappingDiscoveryClient.java deleted file mode 100644 index b7215f337..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationKeyMappingDiscoveryClient.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.service.subscription.ApplicationKeyMappingDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreImpl; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with Application Key Mapping discovery service at the common-controller. - */ -public class ApplicationKeyMappingDiscoveryClient implements Runnable { - private static final Logger logger = LogManager.getLogger(ApplicationKeyMappingDiscoveryClient.class); - private static ApplicationKeyMappingDiscoveryClient instance; - private ManagedChannel channel; - private ApplicationKeyMappingDiscoveryServiceGrpc.ApplicationKeyMappingDiscoveryServiceStub stub; - private StreamObserver reqObserver; - private final SubscriptionDataStoreImpl subscriptionDataStore; - private final String host; - private final String hostname; - private final int port; - - /** - * This is a reference to the latest received response from the ADS. - *

- * Usage: When ack/nack a DiscoveryResponse this value is used to identify the latest received DiscoveryResponse - * which may not have been acked/nacked so far. - *

- */ - - private DiscoveryResponse latestReceived; - /** - * This is a reference to the latest acked response from the ADS. - *

- * Usage: When nack a DiscoveryResponse this value is used to find the latest successfully processed - * DiscoveryResponse. Information sent in the nack request will contain information about this response value. - *

- */ - private DiscoveryResponse latestACKed; - - /** - * Node struct for the discovery client - */ - private final Node node; - - private ApplicationKeyMappingDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.subscriptionDataStore = SubscriptionDataStoreImpl.getInstance(); - initConnection(); - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("Application key mapping discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - this.stub = ApplicationKeyMappingDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopApplicationKeyMappingDiscoveryScheduling(); - } - } - - public static ApplicationKeyMappingDiscoveryClient getInstance() { - if (instance == null) { - String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); - String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); - int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerXdsPort()); - instance = new ApplicationKeyMappingDiscoveryClient(sdsHost, sdsHostname, sdsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchApplicationKeyMappings(); - } - - public void watchApplicationKeyMappings() { - // TODO: (Praminda) implement a deadline with retries - reqObserver = stub.streamApplicationKeyMappings(new StreamObserver() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("Application key generation event received with version : " + response.getVersionInfo()); - logger.debug("Received Application Key Mapping discovery response " + response); - XdsSchedulerManager.getInstance().stopApplicationKeyMappingDiscoveryScheduling(); - latestReceived = response; - try { - List applicationKeyMappingLis = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - applicationKeyMappingLis.addAll(res.unpack(ApplicationKeyMappingList.class).getListList()); - } - subscriptionDataStore.addApplicationKeyMappings(applicationKeyMappingLis); - logger.info("Number of application key mappings received : " + applicationKeyMappingLis.size()); - ack(); - } catch (Exception e) { - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during Application Key Mappings discovery", throwable); - XdsSchedulerManager.getInstance().startApplicationKeyMappingDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving Application Key Mapping data"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.APPLICATION_KEY_MAPPING_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.APPLICATION_KEY_MAPPING_LIST_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in Application Key Mapping discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. This is part of the xDS - * communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.APPLICATION_KEY_MAPPING_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.APPLICATION_KEY_MAPPING_LIST_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationMappingDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationMappingDiscoveryClient.java deleted file mode 100644 index 18df15e92..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationMappingDiscoveryClient.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) 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. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.service.subscription.ApplicationMappingDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreImpl; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with Application Mapping discovery service at the common-controller. - */ -public class ApplicationMappingDiscoveryClient implements Runnable { - private static final Logger logger = LogManager.getLogger(ApplicationMappingDiscoveryClient.class); - private static ApplicationMappingDiscoveryClient instance; - private ManagedChannel channel; - private ApplicationMappingDiscoveryServiceGrpc.ApplicationMappingDiscoveryServiceStub stub; - private StreamObserver reqObserver; - private final SubscriptionDataStoreImpl subscriptionDataStore; - private final String host; - private final String hostname; - private final int port; - - /** - * This is a reference to the latest received response from the ADS. - *

- * Usage: When ack/nack a DiscoveryResponse this value is used to identify the latest received DiscoveryResponse - * which may not have been acked/nacked so far. - *

- */ - private DiscoveryResponse latestReceived; - - /** - * This is a reference to the latest acked response from the ADS. - *

- * Usage: When nack a DiscoveryResponse this value is used to find the latest successfully processed - * DiscoveryResponse. Information sent in the nack request will contain information about this response value. - *

- */ - private DiscoveryResponse latestACKed; - - /** - * Node struct for the discovery client - */ - private final Node node; - - private ApplicationMappingDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.subscriptionDataStore = SubscriptionDataStoreImpl.getInstance(); - initConnection(); - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("Application mapping discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - this.stub = ApplicationMappingDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopApplicationMappingDiscoveryScheduling(); - } - } - - public static ApplicationMappingDiscoveryClient getInstance() { - if (instance == null) { - String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); - String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); - int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerXdsPort()); - instance = new ApplicationMappingDiscoveryClient(sdsHost, sdsHostname, sdsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchApplicationMappings(); - } - - public void watchApplicationMappings() { - // TODO: (Praminda) implement a deadline with retries - reqObserver = stub.streamApplicationMappings(new StreamObserver() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("Application Mapping event received with version : " + response.getVersionInfo()); - logger.debug("Received Application Mapping discovery response " + response); - XdsSchedulerManager.getInstance().stopApplicationMappingDiscoveryScheduling(); - latestReceived = response; - try { - List applicationMappingList = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - applicationMappingList.addAll(res.unpack(ApplicationMappingList.class).getListList()); - } - subscriptionDataStore.addApplicationMappings(applicationMappingList); - logger.info("Number of application mappings received : " + applicationMappingList.size()); - ack(); - } catch (Exception e) { - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during Application Mappings discovery", throwable); - XdsSchedulerManager.getInstance().startApplicationMappingDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving Application Mapping data"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.APPLICATION_MAPPING_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.APPLICATION_MAPPING_LIST_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in Application Mapping discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. This is part of the xDS - * communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.APPLICATION_MAPPING_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.APPLICATION_MAPPING_LIST_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationPolicyDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationPolicyDiscoveryClient.java deleted file mode 100644 index 1a63aa033..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/ApplicationPolicyDiscoveryClient.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.service.subscription.ApplicationPolicyDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy; -import org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreImpl; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with Application Policy discovery service at the adapter. - */ -public class ApplicationPolicyDiscoveryClient implements Runnable { - private static final Logger logger = LogManager.getLogger(ApplicationPolicyDiscoveryClient.class); - private static ApplicationPolicyDiscoveryClient instance; - private ManagedChannel channel; - private ApplicationPolicyDiscoveryServiceGrpc.ApplicationPolicyDiscoveryServiceStub stub; - private StreamObserver reqObserver; - private final SubscriptionDataStoreImpl subscriptionDataStore; - private final String host; - private final String hostname; - private final int port; - - /** - * This is a reference to the latest received response from the ADS. - *

- * Usage: When ack/nack a DiscoveryResponse this value is used to identify the latest received DiscoveryResponse - * which may not have been acked/nacked so far. - *

- */ - - private DiscoveryResponse latestReceived; - /** - * This is a reference to the latest acked response from the ADS. - *

- * Usage: When nack a DiscoveryResponse this value is used to find the latest successfully processed - * DiscoveryResponse. Information sent in the nack request will contain information about this response value. - *

- */ - private DiscoveryResponse latestACKed; - - /** - * Node struct for the discovery client - */ - private final Node node; - - private ApplicationPolicyDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.subscriptionDataStore = SubscriptionDataStoreImpl.getInstance(); - initConnection(); - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("Application policy discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - this.stub = ApplicationPolicyDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopApplicationPolicyDiscoveryScheduling(); - } - } - - public static ApplicationPolicyDiscoveryClient getInstance() { - if (instance == null) { - String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHost(); - String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHostname(); - int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getAdapterXdsPort()); - instance = new ApplicationPolicyDiscoveryClient(sdsHost, sdsHostname, sdsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchApplicationPolicies(); - } - - public void watchApplicationPolicies() { - // TODO: (Praminda) implement a deadline with retries - reqObserver = stub.streamApplicationPolicies(new StreamObserver() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("Application policy event received with version : " + response.getVersionInfo()); - logger.debug("Received Application Policy discovery response " + response); - XdsSchedulerManager.getInstance().stopApplicationPolicyDiscoveryScheduling(); - latestReceived = response; - try { - List applicationPolicyList = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - applicationPolicyList.addAll(res.unpack(ApplicationPolicyList.class).getListList()); - } - subscriptionDataStore.addApplicationPolicies(applicationPolicyList); - logger.info("Number of application policies received : " + applicationPolicyList.size()); - ack(); - } catch (Exception e) { - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during Application Policy discovery", throwable); - XdsSchedulerManager.getInstance().startApplicationPolicyDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving Application Policy data"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.APPLICATION_POLICY_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.APPLICATION_POLICY_LIST_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in Application Policy discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. This is part of the xDS - * communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.APPLICATION_POLICY_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.APPLICATION_POLICY_LIST_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/SubscriptionDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/SubscriptionDiscoveryClient.java deleted file mode 100644 index 61c317b63..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/SubscriptionDiscoveryClient.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.service.subscription.SubscriptionDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.discovery.subscription.Subscription; -import org.wso2.apk.enforcer.discovery.subscription.SubscriptionList; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreImpl; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with Subscription discovery service at the common-controller. - */ -public class SubscriptionDiscoveryClient implements Runnable { - private static final Logger logger = LogManager.getLogger(SubscriptionDiscoveryClient.class); - private static SubscriptionDiscoveryClient instance; - private ManagedChannel channel; - private SubscriptionDiscoveryServiceGrpc.SubscriptionDiscoveryServiceStub stub; - private StreamObserver reqObserver; - private final SubscriptionDataStoreImpl subscriptionDataStore; - private final String host; - private final String hostname; - private final int port; - - /** - * This is a reference to the latest received response from the ADS. - *

- * Usage: When ack/nack a DiscoveryResponse this value is used to identify the latest received DiscoveryResponse - * which may not have been acked/nacked so far. - *

- */ - - private DiscoveryResponse latestReceived; - /** - * This is a reference to the latest acked response from the ADS. - *

- * Usage: When nack a DiscoveryResponse this value is used to find the latest successfully processed - * DiscoveryResponse. Information sent in the nack request will contain information about this response value. - *

- */ - private DiscoveryResponse latestACKed; - /** - * Node struct for the discovery client - */ - private final Node node; - - private SubscriptionDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.subscriptionDataStore = SubscriptionDataStoreImpl.getInstance(); - initConnection(); - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("Subscription discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - this.stub = SubscriptionDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopSubscriptionDiscoveryScheduling(); - } - } - - public static SubscriptionDiscoveryClient getInstance() { - if (instance == null) { - String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); - String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); - int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerXdsPort()); - instance = new SubscriptionDiscoveryClient(sdsHost, sdsHostname, sdsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchSubscriptions(); - } - - public void watchSubscriptions() { - // TODO: (Praminda) implement a deadline with retries - reqObserver = stub.streamSubscriptions(new StreamObserver() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("Subscription event received with version : " + response.getVersionInfo()); - logger.debug("Received Subscription discovery response " + response); - XdsSchedulerManager.getInstance().stopSubscriptionDiscoveryScheduling(); - latestReceived = response; - try { - List subscriptionList = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - subscriptionList.addAll(res.unpack(SubscriptionList.class).getListList()); - } - subscriptionDataStore.addSubscriptions(subscriptionList); - logger.info("Number of subscriptions received : " + subscriptionList.size()); - ack(); - - } catch (Exception e) { - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during Subscription discovery", throwable); - XdsSchedulerManager.getInstance().startSubscriptionDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving Subscription data"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.SUBSCRIPTION_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.SUBSCRIPTION_LIST_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in API discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. This is part of the xDS - * communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.SUBSCRIPTION_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.SUBSCRIPTION_LIST_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/SubscriptionPolicyDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/SubscriptionPolicyDiscoveryClient.java deleted file mode 100644 index 3498b9c36..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/SubscriptionPolicyDiscoveryClient.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.service.subscription.SubscriptionPolicyDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy; -import org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreImpl; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with Subscription Policy discovery service at the adapter. - */ -public class SubscriptionPolicyDiscoveryClient implements Runnable { - private static final Logger logger = LogManager.getLogger(SubscriptionPolicyDiscoveryClient.class); - private static SubscriptionPolicyDiscoveryClient instance; - private ManagedChannel channel; - private SubscriptionPolicyDiscoveryServiceGrpc.SubscriptionPolicyDiscoveryServiceStub stub; - private StreamObserver reqObserver; - private final SubscriptionDataStoreImpl subscriptionDataStore; - private final String host; - private final String hostname; - private final int port; - - /** - * This is a reference to the latest received response from the ADS. - *

- * Usage: When ack/nack a DiscoveryResponse this value is used to identify the latest received DiscoveryResponse - * which may not have been acked/nacked so far. - *

- */ - - private DiscoveryResponse latestReceived; - /** - * This is a reference to the latest acked response from the ADS. - *

- * Usage: When nack a DiscoveryResponse this value is used to find the latest successfully processed - * DiscoveryResponse. Information sent in the nack request will contain information about this response value. - *

- */ - private DiscoveryResponse latestACKed; - /** - * Node struct for the discovery client - */ - private final Node node; - - private SubscriptionPolicyDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.subscriptionDataStore = SubscriptionDataStoreImpl.getInstance(); - initConnection(); - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - logger.error("Subscription policy discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); - this.stub = SubscriptionPolicyDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopSubscriptionPolicyDiscoveryScheduling(); - } - } - - public static SubscriptionPolicyDiscoveryClient getInstance() { - if (instance == null) { - String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHost(); - String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHostname(); - int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getAdapterXdsPort()); - instance = new SubscriptionPolicyDiscoveryClient(sdsHost, sdsHostname, sdsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchSubscriptionPolicies(); - } - - public void watchSubscriptionPolicies() { - // TODO: (Praminda) implement a deadline with retries - reqObserver = stub.streamSubscriptionPolicies(new StreamObserver<>() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("Subscription policy event received with version : " + response.getVersionInfo()); - logger.debug("Received Subscription policy discovery response " + response); - XdsSchedulerManager.getInstance().stopSubscriptionPolicyDiscoveryScheduling(); - latestReceived = response; - try { - List subscriptionPolicyList = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - subscriptionPolicyList.addAll(res.unpack(SubscriptionPolicyList.class).getListList()); - } - subscriptionDataStore.addSubscriptionPolicies(subscriptionPolicyList); - logger.info("Number of subscription policies received : " + subscriptionPolicyList.size()); - ack(); - } catch (Exception e) { - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during Subscription discovery", throwable); - XdsSchedulerManager.getInstance().startSubscriptionPolicyDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving Subscription data"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.SUBSCRIPTION_POLICY_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.SUBSCRIPTION_POLICY_LIST_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in API discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. This is part of the xDS - * communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.SUBSCRIPTION_POLICY_LIST_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.SUBSCRIPTION_POLICY_LIST_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java index a23c03879..5440c8bda 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java @@ -21,15 +21,9 @@ import org.wso2.apk.enforcer.config.EnvVarConfig; import org.wso2.apk.enforcer.discovery.ApiDiscoveryClient; import org.wso2.apk.enforcer.discovery.ApiListDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ApplicationDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ApplicationKeyMappingDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ApplicationMappingDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ApplicationPolicyDiscoveryClient; import org.wso2.apk.enforcer.discovery.ConfigDiscoveryClient; import org.wso2.apk.enforcer.discovery.JWTIssuerDiscoveryClient; import org.wso2.apk.enforcer.discovery.RevokedTokenDiscoveryClient; -import org.wso2.apk.enforcer.discovery.SubscriptionDiscoveryClient; -import org.wso2.apk.enforcer.discovery.SubscriptionPolicyDiscoveryClient; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -40,23 +34,16 @@ * Manages all the scheduling tasks that runs for retrying discovery requests. */ public class XdsSchedulerManager { + private static int retryPeriod; private static volatile XdsSchedulerManager instance; private static ScheduledExecutorService discoveryClientScheduler; private ScheduledFuture apiDiscoveryScheduledFuture; private ScheduledFuture apiDiscoveryListScheduledFuture; - private ScheduledFuture applicationDiscoveryScheduledFuture; private ScheduledFuture jwtIssuerDiscoveryScheduledFuture; - private ScheduledFuture applicationKeyMappingDiscoveryScheduledFuture; - private ScheduledFuture applicationMappingDiscoveryScheduledFuture; - private ScheduledFuture keyManagerDiscoveryScheduledFuture; private ScheduledFuture revokedTokenDiscoveryScheduledFuture; - private ScheduledFuture subscriptionDiscoveryScheduledFuture; - private ScheduledFuture throttleDataDiscoveryScheduledFuture; private ScheduledFuture configDiscoveryScheduledFuture; - private ScheduledFuture applicationPolicyDiscoveryScheduledFuture; - private ScheduledFuture subscriptionPolicyDiscoveryScheduledFuture; public static XdsSchedulerManager getInstance() { if (instance == null) { @@ -97,49 +84,20 @@ public synchronized void stopAPIListDiscoveryScheduling() { } } - public synchronized void startApplicationDiscoveryScheduling() { - if (applicationDiscoveryScheduledFuture == null || applicationDiscoveryScheduledFuture.isDone()) { - applicationDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(ApplicationDiscoveryClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); - } - } - public synchronized void startJWTIssuerDiscoveryScheduling(){ + public synchronized void startJWTIssuerDiscoveryScheduling() { + if (jwtIssuerDiscoveryScheduledFuture == null || jwtIssuerDiscoveryScheduledFuture.isDone()) { jwtIssuerDiscoveryScheduledFuture = discoveryClientScheduler .scheduleWithFixedDelay(JWTIssuerDiscoveryClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); } } - public synchronized void stopApplicationDiscoveryScheduling() { - if (applicationDiscoveryScheduledFuture != null && !applicationDiscoveryScheduledFuture.isDone()) { - applicationDiscoveryScheduledFuture.cancel(false); - } - } - public synchronized void stopJWTIssuerDiscoveryScheduling() { if (jwtIssuerDiscoveryScheduledFuture != null && !jwtIssuerDiscoveryScheduledFuture.isDone()) { jwtIssuerDiscoveryScheduledFuture.cancel(false); } } - public synchronized void startApplicationKeyMappingDiscoveryScheduling() { - if (applicationKeyMappingDiscoveryScheduledFuture == null || applicationKeyMappingDiscoveryScheduledFuture - .isDone()) { - applicationKeyMappingDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(ApplicationKeyMappingDiscoveryClient.getInstance(), 1, retryPeriod, - TimeUnit.SECONDS); - } - } - - public synchronized void stopApplicationKeyMappingDiscoveryScheduling() { - if (applicationKeyMappingDiscoveryScheduledFuture != null && !applicationKeyMappingDiscoveryScheduledFuture - .isDone()) { - applicationKeyMappingDiscoveryScheduledFuture.cancel(false); - } - } - - - public synchronized void startRevokedTokenDiscoveryScheduling() { if (revokedTokenDiscoveryScheduledFuture == null || revokedTokenDiscoveryScheduledFuture.isDone()) { revokedTokenDiscoveryScheduledFuture = discoveryClientScheduler @@ -154,20 +112,6 @@ public synchronized void stopRevokedTokenDiscoveryScheduling() { } } - public synchronized void startSubscriptionDiscoveryScheduling() { - if (subscriptionDiscoveryScheduledFuture == null || subscriptionDiscoveryScheduledFuture.isDone()) { - subscriptionDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(SubscriptionDiscoveryClient.getInstance(), 1, retryPeriod, - TimeUnit.SECONDS); - } - } - - public synchronized void stopSubscriptionDiscoveryScheduling() { - if (subscriptionDiscoveryScheduledFuture != null && !subscriptionDiscoveryScheduledFuture.isDone()) { - subscriptionDiscoveryScheduledFuture.cancel(false); - } - } - public synchronized void startConfigDiscoveryScheduling() { if (configDiscoveryScheduledFuture == null || configDiscoveryScheduledFuture.isDone()) { configDiscoveryScheduledFuture = discoveryClientScheduler @@ -182,47 +126,4 @@ public synchronized void stopConfigDiscoveryScheduling() { } } - public synchronized void startApplicationPolicyDiscoveryScheduling() { - if (applicationPolicyDiscoveryScheduledFuture == null || applicationPolicyDiscoveryScheduledFuture.isDone()) { - applicationPolicyDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(ApplicationPolicyDiscoveryClient.getInstance(), 1, retryPeriod, - TimeUnit.SECONDS); - } - } - - public synchronized void stopApplicationPolicyDiscoveryScheduling() { - if (applicationPolicyDiscoveryScheduledFuture != null && !applicationPolicyDiscoveryScheduledFuture.isDone()) { - applicationPolicyDiscoveryScheduledFuture.cancel(false); - } - } - - public synchronized void startSubscriptionPolicyDiscoveryScheduling() { - if (subscriptionPolicyDiscoveryScheduledFuture == null || subscriptionPolicyDiscoveryScheduledFuture.isDone()) { - subscriptionPolicyDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(SubscriptionPolicyDiscoveryClient.getInstance(), 1, retryPeriod, - TimeUnit.SECONDS); - } - } - - public synchronized void stopSubscriptionPolicyDiscoveryScheduling() { - if (subscriptionPolicyDiscoveryScheduledFuture != null && !subscriptionPolicyDiscoveryScheduledFuture - .isDone()) { - subscriptionPolicyDiscoveryScheduledFuture.cancel(false); - } - } - - public synchronized void startApplicationMappingDiscoveryScheduling() { - if (applicationMappingDiscoveryScheduledFuture == null || applicationMappingDiscoveryScheduledFuture.isDone()) { - applicationMappingDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(ApplicationMappingDiscoveryClient.getInstance(), 1, retryPeriod, - TimeUnit.SECONDS); - } - } - - public synchronized void stopApplicationMappingDiscoveryScheduling() { - if (applicationMappingDiscoveryScheduledFuture != null && !applicationMappingDiscoveryScheduledFuture - .isDone()) { - applicationMappingDiscoveryScheduledFuture.cancel(false); - } - } } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPAClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPAClient.java index 15a39c414..3e013f76b 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPAClient.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/interceptor/opa/OPAClient.java @@ -99,7 +99,7 @@ public boolean validateRequest(RequestContext requestContext, Map clientOptions = new HashMap<>(); + Map clientOptions = new HashMap<>(); FilterUtils.putToMapIfNotNull(clientOptions, FilterUtils.HTTPClientOptions.MAX_OPEN_CONNECTIONS, policyAttrib.get("maxOpenConnections")); FilterUtils.putToMapIfNotNull(clientOptions, FilterUtils.HTTPClientOptions.MAX_PER_ROUTE, @@ -135,7 +135,7 @@ private void loadRequestGenerators() { } private static String callOPAServer(String serverEp, String payload, String token, - Map clientOptions) throws OPASecurityException { + Map clientOptions) throws OPASecurityException { try { URL url = new URL(serverEp); KeyStore opaKeyStore = ConfigHolder.getInstance().getOpaKeyStore(); diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationDto.java new file mode 100644 index 000000000..59aafe9db --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationDto.java @@ -0,0 +1,70 @@ +package org.wso2.apk.enforcer.subscription; + +import java.io.Serializable; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Entity for keeping Application related information. Represents an Application in APK. + */ +public class ApplicationDto implements Serializable { + + private static final long serialVersionUID = 1L; + + private String uuid; + private String name; + private String owner; + private Map attributes = new ConcurrentHashMap<>(); + + private String organizationId; + + public String getUuid() { + + return uuid; + } + + public void setUuid(String uuid) { + + this.uuid = uuid; + } + + public String getName() { + + return name; + } + + public void setName(String name) { + + this.name = name; + } + + public String getOwner() { + + return owner; + } + + public void setOwner(String owner) { + + this.owner = owner; + } + + public Map getAttributes() { + + return attributes; + } + + public void setAttributes(Map attributes) { + + this.attributes = attributes; + } + + public String getOrganizationId() { + + return organizationId; + } + + public void setOrganizationId(String organizationId) { + + this.organizationId = organizationId; + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDTO.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDTO.java new file mode 100644 index 000000000..283f9da9e --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDTO.java @@ -0,0 +1,63 @@ +package org.wso2.apk.enforcer.subscription; + +import java.io.Serializable; + +public class ApplicationKeyMappingDTO implements Serializable { + + public String getApplicationUUID() { + + return applicationUUID; + } + + public void setApplicationUUID(String applicationUUID) { + + this.applicationUUID = applicationUUID; + } + + public String getSecurityScheme() { + + return securityScheme; + } + + public void setSecurityScheme(String securityScheme) { + + this.securityScheme = securityScheme; + } + + public String getApplicationIdentifier() { + + return applicationIdentifier; + } + + public void setApplicationIdentifier(String applicationIdentifier) { + + this.applicationIdentifier = applicationIdentifier; + } + + public String getKeyType() { + + return keyType; + } + + public void setKeyType(String keyType) { + + this.keyType = keyType; + } + + public String getEnvID() { + + return envID; + } + + public void setEnvID(String envID) { + + this.envID = envID; + } + + private String applicationUUID; + private String securityScheme; + private String applicationIdentifier; + private String keyType; + private String envID; + +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDtoList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDtoList.java new file mode 100644 index 000000000..36ab9cba7 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationKeyMappingDtoList.java @@ -0,0 +1,13 @@ +package org.wso2.apk.enforcer.subscription; + +import java.util.ArrayList; +import java.util.List; + +public class ApplicationKeyMappingDtoList { +private List list = new ArrayList<>(); + + public List getList() { + + return list; + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationListDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationListDto.java new file mode 100644 index 000000000..333c3ad32 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationListDto.java @@ -0,0 +1,19 @@ +package org.wso2.apk.enforcer.subscription; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class ApplicationListDto implements Serializable { +private List list = new ArrayList<>(); + + public List getList() { + + return list; + } + + public void setList(List list) { + + this.list = list; + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDto.java new file mode 100644 index 000000000..376266ab8 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDto.java @@ -0,0 +1,40 @@ +package org.wso2.apk.enforcer.subscription; + +import java.io.Serializable; + +public class ApplicationMappingDto implements Serializable { + private String uuid; + + public String getUuid() { + + return uuid; + } + + public void setUuid(String uuid) { + + this.uuid = uuid; + } + + public String getApplicationRef() { + + return applicationRef; + } + + public void setApplicationRef(String applicationRef) { + + this.applicationRef = applicationRef; + } + + public String getSubscriptionRef() { + + return subscriptionRef; + } + + public void setSubscriptionRef(String subscriptionRef) { + + this.subscriptionRef = subscriptionRef; + } + + private String applicationRef; + private String subscriptionRef; +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDtoList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDtoList.java new file mode 100644 index 000000000..8b310b93a --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/ApplicationMappingDtoList.java @@ -0,0 +1,13 @@ +package org.wso2.apk.enforcer.subscription; + +import java.util.ArrayList; +import java.util.List; + +public class ApplicationMappingDtoList { +private List list = new ArrayList<>(); + + public List getList() { + + return list; + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscribedAPIDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscribedAPIDto.java new file mode 100644 index 000000000..0d35afa20 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscribedAPIDto.java @@ -0,0 +1,29 @@ +package org.wso2.apk.enforcer.subscription; + +import java.io.Serializable; + +public class SubscribedAPIDto implements Serializable { + + public String getName() { + + return name; + } + + public void setName(String name) { + + this.name = name; + } + + public String getVersion() { + + return version; + } + + public void setVersion(String version) { + + this.version = version; + } + + private String name; + private String version; +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java index ddcb0ae40..18fe03df2 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java @@ -55,20 +55,14 @@ public interface SubscriptionDataStore { */ Subscription getSubscriptionById(String appUUID, String apiUUID); - void addSubscriptions(List subscriptionList); + void addSubscriptions(List subscriptionList); - void addApplications(List applicationList); + void addApplications(List applicationList); void addApis(List apisList); - void addApplicationPolicies( - List applicationPolicyList); - - void addSubscriptionPolicies( - List subscriptionPolicyList); - void addApplicationKeyMappings( - List applicationKeyMappingList); + List applicationKeyMappingList); /** * Filter the API map according to the provided parameters diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java index 42f1ba786..7b17e2b6e 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java @@ -18,40 +18,39 @@ package org.wso2.apk.enforcer.subscription; +import feign.Feign; +import feign.gson.GsonDecoder; +import feign.gson.GsonEncoder; +import feign.slf4j.Slf4jLogger; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.wso2.apk.enforcer.commons.dto.ClaimMappingDto; import org.wso2.apk.enforcer.commons.dto.JWKSConfigurationDTO; import org.wso2.apk.enforcer.commons.exception.EnforcerException; +import org.wso2.apk.enforcer.config.ConfigHolder; import org.wso2.apk.enforcer.config.dto.ExtendedTokenIssuerDto; import org.wso2.apk.enforcer.constants.Constants; import org.wso2.apk.enforcer.discovery.ApiListDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ApplicationDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ApplicationKeyMappingDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ApplicationMappingDiscoveryClient; -import org.wso2.apk.enforcer.discovery.ApplicationPolicyDiscoveryClient; import org.wso2.apk.enforcer.discovery.JWTIssuerDiscoveryClient; -import org.wso2.apk.enforcer.discovery.SubscriptionDiscoveryClient; -import org.wso2.apk.enforcer.discovery.SubscriptionPolicyDiscoveryClient; import org.wso2.apk.enforcer.discovery.subscription.APIs; import org.wso2.apk.enforcer.discovery.subscription.Certificate; import org.wso2.apk.enforcer.discovery.subscription.JWTIssuer; import org.wso2.apk.enforcer.models.API; -import org.wso2.apk.enforcer.models.ApiPolicy; import org.wso2.apk.enforcer.models.Application; import org.wso2.apk.enforcer.models.ApplicationKeyMapping; import org.wso2.apk.enforcer.models.ApplicationMapping; -import org.wso2.apk.enforcer.models.ApplicationPolicy; import org.wso2.apk.enforcer.models.SubscribedAPI; import org.wso2.apk.enforcer.models.Subscription; -import org.wso2.apk.enforcer.models.SubscriptionPolicy; import org.wso2.apk.enforcer.security.jwt.validator.JWTValidator; +import org.wso2.apk.enforcer.util.ApacheFeignHttpClient; +import org.wso2.apk.enforcer.util.FilterUtils; import org.wso2.apk.enforcer.util.TLSUtils; import java.io.IOException; import java.security.cert.CertificateException; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -65,15 +64,6 @@ public class SubscriptionDataStoreImpl implements SubscriptionDataStore { private static final Logger log = LogManager.getLogger(SubscriptionDataStoreImpl.class); private static final SubscriptionDataStoreImpl instance = new SubscriptionDataStoreImpl(); - /** - * ENUM to hold type of policies. - */ - public enum PolicyType { - SUBSCRIPTION, - APPLICATION, - API - } - public static final String DELEM_PERIOD = ":"; // Maps for keeping Subscription related details. @@ -81,12 +71,10 @@ public enum PolicyType { private Map applicationMappingMap; private Map applicationMap; private Map apiMap; - private Map apiPolicyMap; - private Map subscriptionPolicyMap; - private Map appPolicyMap; private Map subscriptionMap; private Map> jwtValidatorMap; + SubscriptionValidationDataRetrievalRestClient subscriptionValidationDataRetrievalRestClient; SubscriptionDataStoreImpl() { @@ -99,12 +87,21 @@ public static SubscriptionDataStoreImpl getInstance() { public void initializeStore() { + String commonControllerHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); + String commonControllerHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); + int commonControllerRestPort = + Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerRestPort()); + subscriptionValidationDataRetrievalRestClient = Feign.builder() + .encoder(new GsonEncoder()) + .decoder(new GsonDecoder()) + .logger(new Slf4jLogger()) + .client(new ApacheFeignHttpClient(FilterUtils.getMutualSSLHttpClient("https", + Arrays.asList(commonControllerHost, commonControllerHostname)))) + .target(SubscriptionValidationDataRetrievalRestClient.class, + "https://" + commonControllerHost + ":" + commonControllerRestPort); this.applicationKeyMappingMap = new ConcurrentHashMap<>(); this.applicationMap = new ConcurrentHashMap<>(); this.apiMap = new ConcurrentHashMap<>(); - this.subscriptionPolicyMap = new ConcurrentHashMap<>(); - this.appPolicyMap = new ConcurrentHashMap<>(); - this.apiPolicyMap = new ConcurrentHashMap<>(); this.subscriptionMap = new ConcurrentHashMap<>(); this.applicationMappingMap = new ConcurrentHashMap<>(); this.jwtValidatorMap = new ConcurrentHashMap<>(); @@ -130,22 +127,51 @@ public Subscription getSubscriptionById(String appId, String apiId) { } private void initializeLoadingTasks() { - - SubscriptionDiscoveryClient.getInstance().watchSubscriptions(); - ApplicationDiscoveryClient.getInstance().watchApplications(); + loadSubscriptions(); + loadApplications(); + loadApplicationMappings(); + loadApplicationKeyMappings(); ApiListDiscoveryClient.getInstance().watchApiList(); - ApplicationPolicyDiscoveryClient.getInstance().watchApplicationPolicies(); - SubscriptionPolicyDiscoveryClient.getInstance().watchSubscriptionPolicies(); - ApplicationKeyMappingDiscoveryClient.getInstance().watchApplicationKeyMappings(); - ApplicationMappingDiscoveryClient.getInstance().watchApplicationMappings(); JWTIssuerDiscoveryClient.getInstance().watchJWTIssuers(); } - public void addSubscriptions(List subscriptionList) { + private void loadApplicationKeyMappings() { + new Thread(() -> { + ApplicationKeyMappingDtoList applicationKeyMappings = + subscriptionValidationDataRetrievalRestClient.getAllApplicationKeyMappings(); + addApplicationKeyMappings(applicationKeyMappings.getList()); + }).start(); + + } + + private void loadApplicationMappings() { + new Thread(() -> { + ApplicationMappingDtoList applicationMappings = subscriptionValidationDataRetrievalRestClient + .getAllApplicationMappings(); + addApplicationMappings(applicationMappings.getList()); + }).start(); + + } + + private void loadApplications(){ + new Thread(() -> { + ApplicationListDto applications = subscriptionValidationDataRetrievalRestClient.getAllApplications(); + addApplications(applications.getList()); + }).start(); + } + private void loadSubscriptions() { + + new Thread(() -> { + SubscriptionListDto subscriptions = subscriptionValidationDataRetrievalRestClient.getAllSubscriptions(); + addSubscriptions(subscriptions.getList()); + }).start(); + } + + public void addSubscriptions(List subscriptionList) { Map newSubscriptionMap = new ConcurrentHashMap<>(); - for (org.wso2.apk.enforcer.discovery.subscription.Subscription subscription : subscriptionList) { + for (SubscriptionDto subscription : subscriptionList) { SubscribedAPI subscribedAPI = new SubscribedAPI(); subscribedAPI.setName(subscription.getSubscribedApi().getName()); subscribedAPI.setVersion(subscription.getSubscribedApi().getVersion()); @@ -155,8 +181,6 @@ public void addSubscriptions(List applicationList) { + public void addApplications(List applicationList) { Map newApplicationMap = new ConcurrentHashMap<>(); - for (org.wso2.apk.enforcer.discovery.subscription.Application application : applicationList) { + for (ApplicationDto application: applicationList) { Application newApplication = new Application(); newApplication.setUUID(application.getUuid()); newApplication.setName(application.getName()); newApplication.setOwner(application.getOwner()); - application.getAttributesMap().forEach(newApplication::addAttribute); + application.getAttributes().forEach(newApplication::addAttribute); newApplicationMap.put(newApplication.getCacheKey(), newApplication); } @@ -208,57 +232,13 @@ public void addApis(List apisList) { this.apiMap = newApiMap; } - public void addApplicationPolicies( - List applicationPolicyList) { - - Map newAppPolicyMap = new ConcurrentHashMap<>(); - - for (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy applicationPolicy : applicationPolicyList) { - ApplicationPolicy newApplicationPolicy = new ApplicationPolicy(); - newApplicationPolicy.setId(applicationPolicy.getId()); - newApplicationPolicy.setQuotaType(applicationPolicy.getQuotaType()); - newApplicationPolicy.setTenantId(applicationPolicy.getTenantId()); - newApplicationPolicy.setTierName(applicationPolicy.getName()); - - newAppPolicyMap.put(newApplicationPolicy.getCacheKey(), newApplicationPolicy); - } - if (log.isDebugEnabled()) { - log.debug("Total Application Policies in new cache: {}", newAppPolicyMap.size()); - } - this.appPolicyMap = newAppPolicyMap; - } - - public void addSubscriptionPolicies( - List subscriptionPolicyList) { - - Map newSubscriptionPolicyMap = new ConcurrentHashMap<>(); - - for (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy subscriptionPolicy : subscriptionPolicyList) { - SubscriptionPolicy newSubscriptionPolicy = new SubscriptionPolicy(); - newSubscriptionPolicy.setId(subscriptionPolicy.getId()); - newSubscriptionPolicy.setQuotaType(subscriptionPolicy.getQuotaType()); - newSubscriptionPolicy.setRateLimitCount(subscriptionPolicy.getRateLimitCount()); - newSubscriptionPolicy.setRateLimitTimeUnit(subscriptionPolicy.getRateLimitTimeUnit()); - newSubscriptionPolicy.setStopOnQuotaReach(subscriptionPolicy.getStopOnQuotaReach()); - newSubscriptionPolicy.setTenantId(subscriptionPolicy.getTenantId()); - newSubscriptionPolicy.setTierName(subscriptionPolicy.getName()); - newSubscriptionPolicy.setGraphQLMaxComplexity(subscriptionPolicy.getGraphQLMaxComplexity()); - newSubscriptionPolicy.setGraphQLMaxDepth(subscriptionPolicy.getGraphQLMaxDepth()); - - newSubscriptionPolicyMap.put(newSubscriptionPolicy.getCacheKey(), newSubscriptionPolicy); - } - if (log.isDebugEnabled()) { - log.debug("Total Subscription Policies in new cache: {}", newSubscriptionPolicyMap.size()); - } - this.subscriptionPolicyMap = newSubscriptionPolicyMap; - } - public void addApplicationKeyMappings( - List applicationKeyMappingList) { + List applicationKeyMappingList) { Map newApplicationKeyMappingMap = new ConcurrentHashMap<>(); - for (org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping : applicationKeyMappingList) { + for (ApplicationKeyMappingDTO applicationKeyMapping : + applicationKeyMappingList) { ApplicationKeyMapping mapping = new ApplicationKeyMapping(); mapping.setApplicationUUID(applicationKeyMapping.getApplicationUUID()); mapping.setSecurityScheme(applicationKeyMapping.getSecurityScheme()); @@ -274,11 +254,11 @@ public void addApplicationKeyMappings( } public void addApplicationMappings( - List applicationMappingList) { + List applicationMappingList) { Map newApplicationMappingMap = new ConcurrentHashMap<>(); - for (org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping : + for (ApplicationMappingDto applicationMapping : applicationMappingList) { ApplicationMapping appMapping = new ApplicationMapping(); appMapping.setUuid(applicationMapping.getUuid()); @@ -307,7 +287,7 @@ public API getMatchingAPI(String context, String version) { @Override public ApplicationKeyMapping getMatchingApplicationKeyMapping(String applicationIdentifier, String keyType, - String securityScheme) { + String securityScheme) { for (ApplicationKeyMapping applicationKeyMapping : applicationKeyMappingMap.values()) { boolean isApplicationIdentifierMatching = false; @@ -339,6 +319,7 @@ public ApplicationKeyMapping getMatchingApplicationKeyMapping(String application @Override public ApplicationMapping getMatchingApplicationMapping(String uuid) { + for (ApplicationMapping applicationMapping : applicationMappingMap.values()) { if (StringUtils.isNotEmpty(uuid)) { if (applicationMapping.getApplicationRef().equals(uuid)) { @@ -351,6 +332,7 @@ public ApplicationMapping getMatchingApplicationMapping(String uuid) { @Override public Application getMatchingApplication(String uuid) { + for (Application application : applicationMap.values()) { if (StringUtils.isNotEmpty(uuid)) { if (application.getUUID().equals(uuid)) { @@ -363,6 +345,7 @@ public Application getMatchingApplication(String uuid) { @Override public Subscription getMatchingSubscription(String uuid) { + for (Subscription subscription : subscriptionMap.values()) { if (StringUtils.isNotEmpty(uuid)) { if (subscription.getSubscriptionId().equals(uuid)) { @@ -461,9 +444,9 @@ private List getEnvironments(JWTIssuer jwtIssuer) { return environmentsList; } - private String getMapKey(String environment, String issuer) { + private String getMapKey(String environment, String issuer) { + return environment + DELEM_PERIOD + issuer; } - } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDto.java new file mode 100644 index 000000000..c2e7133c1 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDto.java @@ -0,0 +1,55 @@ +package org.wso2.apk.enforcer.subscription; + +import java.io.Serializable; + +/** + * Entity for keeping Application related information. Represents an Application in APK. + */ +public class SubscriptionDto implements Serializable { + + private static final long serialVersionUID = 1L; + private String uuid; + private String organization; + private String subStatus; + private SubscribedAPIDto subscribedApi; + + public String getUuid() { + + return uuid; + } + + public void setUuid(String uuid) { + + this.uuid = uuid; + } + + public String getOrganization() { + + return organization; + } + + public void setOrganization(String organization) { + + this.organization = organization; + } + + public String getSubStatus() { + + return subStatus; + } + + public void setSubStatus(String subStatus) { + + this.subStatus = subStatus; + } + + public SubscribedAPIDto getSubscribedApi() { + + return subscribedApi; + } + + public void setSubscribedApi(SubscribedAPIDto subscribedApi) { + + this.subscribedApi = subscribedApi; + } +} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionListDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionListDto.java new file mode 100644 index 000000000..e89dbc1fb --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionListDto.java @@ -0,0 +1,14 @@ +package org.wso2.apk.enforcer.subscription; + +import java.util.ArrayList; +import java.util.List; + +public class SubscriptionListDto { + + private List list = new ArrayList<>(); + + public List getList() { + + return list; + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionValidationDataRetrievalRestClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionValidationDataRetrievalRestClient.java new file mode 100644 index 000000000..95af008b6 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionValidationDataRetrievalRestClient.java @@ -0,0 +1,23 @@ +package org.wso2.apk.enforcer.subscription; +import feign.Headers; +import feign.Param; +import feign.RequestLine; + +public interface SubscriptionValidationDataRetrievalRestClient { + + @RequestLine("GET /applications") + @Headers("Content-Type: application/json") + ApplicationListDto getAllApplications(); + + @RequestLine("GET /subscriptions") + @Headers("Content-Type: application/json") + SubscriptionListDto getAllSubscriptions(); + + @RequestLine("GET /applicationmappings") + @Headers("Content-Type: application/json") + ApplicationMappingDtoList getAllApplicationMappings(); + + @RequestLine("GET /applicationkeymappings") + @Headers("Content-Type: application/json") + ApplicationKeyMappingDtoList getAllApplicationKeyMappings(); +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/ApacheFeignHttpClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/ApacheFeignHttpClient.java new file mode 100644 index 000000000..398fad2b2 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/ApacheFeignHttpClient.java @@ -0,0 +1,238 @@ +package org.wso2.apk.enforcer.util;/* + * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed 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. + */ + + + +import feign.Client; +import feign.Request; +import feign.Response; +import feign.Util; +import org.apache.http.Header; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.StatusLine; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.Configurable; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.client.methods.RequestBuilder; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static feign.Util.UTF_8; + +/*** + * This class is to be used to get HTTP Client from feign library + * TODO: Remove this once the Http Client library is updated + */ +public final class ApacheFeignHttpClient implements Client { + private static final String ACCEPT_HEADER_NAME = "Accept"; + public static final String CHARSET = "UTF-8"; + + private final HttpClient client; + + public ApacheFeignHttpClient() { + this(HttpClientBuilder.create().build()); + } + + public ApacheFeignHttpClient(HttpClient client) { + this.client = client; + } + + @Override + public Response execute(Request request, Request.Options options) throws IOException { + HttpUriRequest httpUriRequest; + try { + httpUriRequest = toHttpUriRequest(request, options); + } catch (URISyntaxException e) { + throw new IOException("URL '" + request.url() + "' couldn't be parsed into a URI", e); + } + HttpResponse httpResponse = client.execute(httpUriRequest); + return toFeignResponse(httpResponse, request); + } + + HttpUriRequest toHttpUriRequest(Request request, Request.Options options) + throws URISyntaxException { + RequestBuilder requestBuilder = RequestBuilder.create(request.httpMethod().name()); + + // per request timeouts + RequestConfig requestConfig = + (client instanceof Configurable ? RequestConfig.copy(((Configurable) client).getConfig()) + : RequestConfig.custom()) + .setConnectTimeout(options.connectTimeoutMillis()) + .setSocketTimeout(options.readTimeoutMillis()) + .build(); + requestBuilder.setConfig(requestConfig); + + URI uri = new URIBuilder(request.url()).build(); + + requestBuilder.setUri(uri.getScheme() + "://" + uri.getAuthority() + uri.getRawPath()); + + // request query params + List queryParams = + URLEncodedUtils.parse(uri,CHARSET); + for (NameValuePair queryParam : queryParams) { + requestBuilder.addParameter(queryParam); + } + + // request headers + boolean hasAcceptHeader = false; + for (Map.Entry> headerEntry : request.headers().entrySet()) { + String headerName = headerEntry.getKey(); + if (headerName.equalsIgnoreCase(ACCEPT_HEADER_NAME)) { + hasAcceptHeader = true; + } + + if (headerName.equalsIgnoreCase(Util.CONTENT_LENGTH)) { + // The 'Content-Length' header is always set by the Apache client and it + // doesn't like us to set it as well. + continue; + } + + for (String headerValue : headerEntry.getValue()) { + requestBuilder.addHeader(headerName, headerValue); + } + } + // some servers choke on the default accept string, so we'll set it to anything + if (!hasAcceptHeader) { + requestBuilder.addHeader(ACCEPT_HEADER_NAME, "*/*"); + } + + // request body + if (request.body() != null) { + HttpEntity entity = null; + if (request.charset() != null) { + ContentType contentType = getContentType(request); + String content = new String(request.body(), request.charset()); + entity = new StringEntity(content, contentType); + } else { + entity = new ByteArrayEntity(request.body()); + } + + requestBuilder.setEntity(entity); + } else { + requestBuilder.setEntity(new ByteArrayEntity(new byte[0])); + } + + return requestBuilder.build(); + } + + private ContentType getContentType(Request request) { + ContentType contentType = null; + for (Map.Entry> entry : request.headers().entrySet()) + if (entry.getKey().equalsIgnoreCase("Content-Type")) { + Collection values = entry.getValue(); + if (values != null && !values.isEmpty()) { + contentType = ContentType.parse(values.iterator().next()); + if (contentType.getCharset() == null) { + contentType = contentType.withCharset(request.charset()); + } + break; + } + } + return contentType; + } + + Response toFeignResponse(HttpResponse httpResponse, Request request) throws IOException { + StatusLine statusLine = httpResponse.getStatusLine(); + int statusCode = statusLine.getStatusCode(); + + String reason = statusLine.getReasonPhrase(); + + Map> headers = new HashMap>(); + for (Header header : httpResponse.getAllHeaders()) { + String name = header.getName(); + String value = header.getValue(); + + Collection headerValues = headers.get(name); + if (headerValues == null) { + headerValues = new ArrayList(); + headers.put(name, headerValues); + } + headerValues.add(value); + } + + return Response.builder() + .status(statusCode) + .reason(reason) + .headers(headers) + .request(request) + .body(toFeignBody(httpResponse)) + .build(); + } + + Response.Body toFeignBody(HttpResponse httpResponse) { + final HttpEntity entity = httpResponse.getEntity(); + if (entity == null) { + return null; + } + return new Response.Body() { + + @Override + public Integer length() { + return entity.getContentLength() >= 0 && entity.getContentLength() <= Integer.MAX_VALUE + ? (int) entity.getContentLength() + : null; + } + + @Override + public boolean isRepeatable() { + return entity.isRepeatable(); + } + + @Override + public InputStream asInputStream() throws IOException { + return entity.getContent(); + } + + @SuppressWarnings("deprecation") + @Override + public Reader asReader() throws IOException { + return new InputStreamReader(asInputStream(), UTF_8); + } + + @Override + public Reader asReader(Charset charset) throws IOException { + Util.checkNotNull(charset, "charset should not be null"); + return new InputStreamReader(asInputStream(), charset); + } + + @Override + public void close() throws IOException { + EntityUtils.consume(entity); + } + }; + } +} \ No newline at end of file diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/FilterUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/FilterUtils.java index 14db15b6d..1c768c3f1 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/FilterUtils.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/FilterUtils.java @@ -31,7 +31,6 @@ import org.apache.http.conn.ssl.SSLContextBuilder; import org.apache.http.conn.ssl.SSLContexts; import org.apache.http.conn.ssl.SSLSocketFactory; -import org.apache.http.conn.ssl.X509HostnameVerifier; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.logging.log4j.LogManager; @@ -72,9 +71,10 @@ import java.util.List; import java.util.Map; import java.util.UUID; - +import javax.net.ssl.HostnameVerifier; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; /** * Common set of utility methods used by the filter core component. @@ -103,9 +103,18 @@ public static String getMaskedToken(String token) { * @return HTTP client */ public static HttpClient getHttpClient(String protocol) { + return getHttpClient(null, null, null); } + public static HttpClient getMutualSSLHttpClient(String protocol, List hostnames) { + + Map options = new HashMap<>(); + options.put("HOSTNAMES", hostnames); + return getHttpClient(ConfigHolder.getInstance().getKeyStore(), ConfigHolder.getInstance().getTrustStore(), + options); + } + /** * Return a http client instance. * @@ -113,13 +122,11 @@ public static HttpClient getHttpClient(String protocol) { * @param options - HTTP client options * @return HTTP client */ - public static HttpClient getHttpClient(KeyStore clientKeyStore, KeyStore clientTrustStore, Map options) { - - // APIManagerConfiguration configuration = ServiceReferenceHolder.getInstance(). - // getAPIManagerConfigurationService().getAPIManagerConfiguration(); + public static HttpClient getHttpClient(KeyStore clientKeyStore, KeyStore clientTrustStore, + Map options) { - String maxTotal = "100"; //TODO : Read from config - String defaultMaxPerRoute = "10"; //TODO : Read from config + int maxTotal = 100; //TODO : Read from config + int defaultMaxPerRoute = 10; //TODO : Read from config if (options == null) { options = Collections.emptyMap(); @@ -127,27 +134,27 @@ public static HttpClient getHttpClient(KeyStore clientKeyStore, KeyStore clientT PoolingHttpClientConnectionManager pool = null; try { - pool = getPoolingHttpClientConnectionManager(clientKeyStore, clientTrustStore); - pool.setMaxTotal(Integer.parseInt(options.getOrDefault(HTTPClientOptions.MAX_OPEN_CONNECTIONS, - maxTotal))); - pool.setDefaultMaxPerRoute(Integer.parseInt(options.getOrDefault(HTTPClientOptions.MAX_PER_ROUTE, - defaultMaxPerRoute))); + pool = getPoolingHttpClientConnectionManager(clientKeyStore, clientTrustStore, options); + pool.setMaxTotal((Integer) options.getOrDefault(HTTPClientOptions.MAX_OPEN_CONNECTIONS, maxTotal)); + pool.setDefaultMaxPerRoute((Integer) options.getOrDefault(HTTPClientOptions.MAX_PER_ROUTE, + defaultMaxPerRoute)); } catch (EnforcerException e) { log.error("Error while getting http client connection manager", e); } RequestConfig.Builder pramsBuilder = RequestConfig.custom(); if (options.containsKey(HTTPClientOptions.CONNECT_TIMEOUT)) { - pramsBuilder.setConnectTimeout(Integer.parseInt(options.get(HTTPClientOptions.CONNECT_TIMEOUT))); + pramsBuilder.setConnectTimeout((Integer) options.get(HTTPClientOptions.CONNECT_TIMEOUT)); } if (options.containsKey(HTTPClientOptions.SOCKET_TIMEOUT)) { - pramsBuilder.setSocketTimeout(Integer.parseInt(options.get(HTTPClientOptions.SOCKET_TIMEOUT))); + pramsBuilder.setSocketTimeout((Integer) options.get(HTTPClientOptions.SOCKET_TIMEOUT)); } RequestConfig params = pramsBuilder.build(); return HttpClients.custom().setConnectionManager(pool).setDefaultRequestConfig(params).build(); } public static KeyStore createClientKeyStore(String certPath, String keyPath) { + try { Certificate cert = TLSUtils.getCertificateFromFile(certPath); Key key = JWTUtils.getPrivateKey(keyPath); @@ -157,8 +164,8 @@ public static KeyStore createClientKeyStore(String certPath, String keyPath) { KeyManagerFactory keyMgrFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); keyMgrFactory.init(opaKeyStore, null); return opaKeyStore; - } catch (KeyStoreException | IOException | NoSuchAlgorithmException | CertificateException | EnforcerException - | UnrecoverableKeyException e) { + } catch (KeyStoreException | IOException | NoSuchAlgorithmException | CertificateException | EnforcerException | + UnrecoverableKeyException e) { log.error("Error creating client KeyStore by loading cert and key from file", ErrorDetails.errorLog(LoggingConstants.Severity.MAJOR, 7100), e); return null; @@ -170,20 +177,21 @@ public static KeyStore createClientKeyStore(String certPath, String keyPath) { * * @return PoolManager */ - private static PoolingHttpClientConnectionManager getPoolingHttpClientConnectionManager( - KeyStore clientKeyStore, KeyStore clientTrustStore) throws EnforcerException { - - SSLConnectionSocketFactory socketFactory = createSocketFactory(clientKeyStore, clientTrustStore); - org.apache.http.config.Registry socketFactoryRegistry = - RegistryBuilder.create() - .register(APIConstants.HTTP_PROTOCOL, PlainConnectionSocketFactory.getSocketFactory()) - .register(APIConstants.HTTPS_PROTOCOL, socketFactory) - .build(); + private static PoolingHttpClientConnectionManager getPoolingHttpClientConnectionManager(KeyStore clientKeyStore, + KeyStore clientTrustStore + , Map options) throws EnforcerException { + + SSLConnectionSocketFactory socketFactory = createSocketFactory(clientKeyStore, clientTrustStore, options); + org.apache.http.config.Registry socketFactoryRegistry = + RegistryBuilder.create().register(APIConstants.HTTP_PROTOCOL, + PlainConnectionSocketFactory.getSocketFactory()).register(APIConstants.HTTPS_PROTOCOL, + socketFactory).build(); return new PoolingHttpClientConnectionManager(socketFactoryRegistry); } - private static SSLConnectionSocketFactory createSocketFactory(KeyStore clientKeyStore, KeyStore clientTrustStore) - throws EnforcerException { + private static SSLConnectionSocketFactory createSocketFactory(KeyStore clientKeyStore, KeyStore clientTrustStore, + Map options) throws EnforcerException { + SSLContext sslContext; try { KeyStore trustStore = ConfigHolder.getInstance().getTrustStore(); @@ -196,9 +204,22 @@ private static SSLConnectionSocketFactory createSocketFactory(KeyStore clientKey } sslContext = sslContextBuilder.build(); - X509HostnameVerifier hostnameVerifier; + HostnameVerifier hostnameVerifier; String hostnameVerifierOption = System.getProperty(HOST_NAME_VERIFIER); - + Object hostnames = options.get("HOSTNAMES"); + if (hostnames instanceof List) { + hostnameVerifier = new HostnameVerifier() { + + @Override + public boolean verify(String hostname, SSLSession session) { + + if (hostnames != null && ((List) hostnames).contains(hostname)) { + return true; + } + return false; + } + }; + } if (ALLOW_ALL.equalsIgnoreCase(hostnameVerifierOption)) { hostnameVerifier = SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER; } else if (STRICT.equalsIgnoreCase(hostnameVerifierOption)) { @@ -224,6 +245,7 @@ public static void handleException(String msg, Throwable t) throws EnforcerExcep } public static String getTenantDomainFromRequestURL(String requestURI) { + String domain = null; if (requestURI.contains("/t/")) { int index = requestURI.indexOf("/t/"); @@ -235,6 +257,7 @@ public static String getTenantDomainFromRequestURL(String requestURI) { } public static AuthenticationContext generateAuthenticationContextForUnsecured(RequestContext requestContext) { + AuthenticationContext authContext = requestContext.getAuthenticationContext(); String clientIP = requestContext.getClientIp(); @@ -263,9 +286,8 @@ public static AuthenticationContext generateAuthenticationContextForUnsecured(Re public static AuthenticationContext generateAuthenticationContext(RequestContext requestContext, String jti, JWTValidationInfo jwtValidationInfo, - APIKeyValidationInfoDTO apiKeyValidationInfoDTO, - String endUserToken, String rawToken, - boolean isOauth) { + APIKeyValidationInfoDTO apiKeyValidationInfoDTO + , String endUserToken, String rawToken, boolean isOauth) { AuthenticationContext authContext = requestContext.getAuthenticationContext(); authContext.setAuthenticated(true); @@ -346,9 +368,8 @@ public static BigInteger ipToBigInteger(String ipAddress) { * @throws java.text.ParseException */ public static AuthenticationContext generateAuthenticationContext(String tokenIdentifier, JWTClaimsSet payload, - JSONObject api, - String apiUUID, String rawToken) - throws java.text.ParseException { + JSONObject api, String apiUUID, + String rawToken) throws java.text.ParseException { AuthenticationContext authContext = new AuthenticationContext(); authContext.setAuthenticated(true); @@ -365,8 +386,7 @@ public static AuthenticationContext generateAuthenticationContext(String tokenId authContext.setApiUUID(apiUUID); } authContext.setApplicationName(APIConstants.JwtTokenConstants.INTERNAL_KEY_APP_NAME); - authContext.setApplicationUUID(UUID.nameUUIDFromBytes(APIConstants.JwtTokenConstants.INTERNAL_KEY_APP_NAME. - getBytes(StandardCharsets.UTF_8)).toString()); + authContext.setApplicationUUID(UUID.nameUUIDFromBytes(APIConstants.JwtTokenConstants.INTERNAL_KEY_APP_NAME.getBytes(StandardCharsets.UTF_8)).toString()); authContext.setApplicationTier(APIConstants.UNLIMITED_TIER); authContext.setSubscriber(APIConstants.JwtTokenConstants.INTERNAL_KEY_APP_NAME); return authContext; @@ -386,8 +406,8 @@ public static JWTInfoDto generateJWTInfoDto(JSONObject subscribedAPI, JWTValidat return jwtInfoDto; } - private static void constructJWTContent(JSONObject subscribedAPI, - APIKeyValidationInfoDTO apiKeyValidationInfoDTO, JWTInfoDto jwtInfoDto) { + private static void constructJWTContent(JSONObject subscribedAPI, APIKeyValidationInfoDTO apiKeyValidationInfoDTO + , JWTInfoDto jwtInfoDto) { Map claims = getClaimsFromJWTValidationInfo(jwtInfoDto); if (claims != null) { @@ -419,20 +439,15 @@ private static void constructJWTContent(JSONObject subscribedAPI, String apiName = subscribedAPI.getAsString(JwtConstants.API_NAME); jwtInfoDto.setApiName(apiName); String subscriptionTier = subscribedAPI.getAsString(JwtConstants.SUBSCRIPTION_TIER); - String subscriptionTenantDomain = - subscribedAPI.getAsString(JwtConstants.SUBSCRIBER_TENANT_DOMAIN); + String subscriptionTenantDomain = subscribedAPI.getAsString(JwtConstants.SUBSCRIBER_TENANT_DOMAIN); jwtInfoDto.setSubscriptionTier(subscriptionTier); jwtInfoDto.setEndUserTenantId(0); if (claims != null && claims.get(JwtConstants.APPLICATION) != null) { - JSONObject - applicationObj = (JSONObject) claims.get(JwtConstants.APPLICATION); - jwtInfoDto.setApplicationId( - String.valueOf(applicationObj.getAsNumber(JwtConstants.APPLICATION_ID))); - jwtInfoDto - .setApplicationName(applicationObj.getAsString(JwtConstants.APPLICATION_NAME)); - jwtInfoDto - .setApplicationTier(applicationObj.getAsString(JwtConstants.APPLICATION_TIER)); + JSONObject applicationObj = (JSONObject) claims.get(JwtConstants.APPLICATION); + jwtInfoDto.setApplicationId(String.valueOf(applicationObj.getAsNumber(JwtConstants.APPLICATION_ID))); + jwtInfoDto.setApplicationName(applicationObj.getAsString(JwtConstants.APPLICATION_NAME)); + jwtInfoDto.setApplicationTier(applicationObj.getAsString(JwtConstants.APPLICATION_TIER)); jwtInfoDto.setSubscriber(applicationObj.getAsString(JwtConstants.APPLICATION_OWNER)); } } @@ -455,6 +470,7 @@ private static Map getClaimsFromJWTValidationInfo(JWTInfoDto jwt * @param e - APISecurityException thrown when validation failure happens at filter level. */ public static void setErrorToContext(RequestContext requestContext, APISecurityException e) { + Map requestContextProperties = requestContext.getProperties(); if (!requestContextProperties.containsKey(APIConstants.MessageFormat.STATUS_CODE)) { requestContext.getProperties().put(APIConstants.MessageFormat.STATUS_CODE, e.getStatusCode()); @@ -483,6 +499,7 @@ public static void setErrorToContext(RequestContext requestContext, APISecurityE */ public static void setErrorToContext(RequestContext context, int errorCode, int statusCode, String message, String desc) { + Map properties = context.getProperties(); properties.putIfAbsent(APIConstants.MessageFormat.STATUS_CODE, statusCode); properties.putIfAbsent(APIConstants.MessageFormat.ERROR_CODE, String.valueOf(errorCode)); @@ -499,12 +516,13 @@ public static void setErrorToContext(RequestContext context, int errorCode, int * @param requestContext - The context object holds details about the specific request. */ public static void setUnauthenticatedErrorToContext(RequestContext requestContext) { - requestContext.getProperties() - .put(APIConstants.MessageFormat.STATUS_CODE, APIConstants.StatusCodes.UNAUTHENTICATED.getCode()); - requestContext.getProperties() - .put(APIConstants.MessageFormat.ERROR_CODE, APISecurityConstants.API_AUTH_INVALID_CREDENTIALS); - requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, APISecurityConstants - .getAuthenticationFailureMessage(APISecurityConstants.API_AUTH_INVALID_CREDENTIALS)); + + requestContext.getProperties().put(APIConstants.MessageFormat.STATUS_CODE, + APIConstants.StatusCodes.UNAUTHENTICATED.getCode()); + requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_CODE, + APISecurityConstants.API_AUTH_INVALID_CREDENTIALS); + requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_MESSAGE, + APISecurityConstants.getAuthenticationFailureMessage(APISecurityConstants.API_AUTH_INVALID_CREDENTIALS)); requestContext.getProperties().put(APIConstants.MessageFormat.ERROR_DESCRIPTION, APISecurityConstants.API_AUTH_INVALID_CREDENTIALS_DESCRIPTION); } @@ -518,6 +536,7 @@ public static void setUnauthenticatedErrorToContext(RequestContext requestContex * @return A map of type {@code } */ public static Map generateMap(Collection list) { + if (list == null) { return new HashMap<>(); } @@ -537,6 +556,7 @@ public static Map generateMap(Collection list) { * @return tenant domain appended username */ public static String buildUsernameWithTenant(String username, String tenantDomain) { + if (StringUtils.isEmpty(tenantDomain)) { tenantDomain = APIConstants.SUPER_TENANT_DOMAIN_NAME; } @@ -549,6 +569,7 @@ public static String buildUsernameWithTenant(String username, String tenantDomai } public static String getClientIp(Map headers, String knownIp) { + String clientIp = knownIp; String xForwardFor = headers.get(APIConstants.X_FORWARDED_FOR); if (!StringUtils.isEmpty(xForwardFor)) { @@ -563,6 +584,7 @@ public static String getClientIp(Map headers, String knownIp) { } public static String getCertificateHeaderName() { + MutualSSLDto mtlsInfo = ConfigHolder.getInstance().getConfig().getMtlsInfo(); String certificateHeaderName = mtlsInfo.getCertificateHeader(); if (StringUtils.isEmpty(certificateHeaderName)) { @@ -578,6 +600,7 @@ public static String getCertificateHeaderName() { * @return whether the fault scenario should be skipped from publishing to analytics server. */ public static boolean isSkippedAnalyticsFaultEvent(String errorCode) { + return SKIPPED_FAULT_CODES.contains(errorCode); } @@ -587,6 +610,7 @@ public static long getTimeStampSkewInSeconds() { } public static void putToMapIfNotNull(Map map, K key, V value) { + if (value != null) { map.put(key, value); } @@ -597,6 +621,7 @@ public static void putToMapIfNotNull(Map map, K key, V value) { * getHttpClient} */ public static class HTTPClientOptions { + public static final String CONNECT_TIMEOUT = "CONNECT_TIMEOUT"; public static final String SOCKET_TIMEOUT = "SOCKET_TIMEOUT"; public static final String MAX_OPEN_CONNECTIONS = "MAX_OPEN_CONNECTIONS"; diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml index c7ca9f256..0426ebc38 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml @@ -44,6 +44,14 @@ spec: - name: ADAPTER_XDS_PORT value : "18000" command: ['sh', '-c', 'echo -e "Checking for the availability of Adapter deployment"; while ! nc -z $ADAPTER_HOST $ADAPTER_XDS_PORT; do sleep 1; printf "-"; done; echo -e " >> Adapter has started";'] + - name: check-common-controller + image: busybox:1.32 + env: + - name: COMMON_CONTROLLER_HOST_NAME + value: {{ template "apk-helm.resource.prefix" . }}-common-controller-service.{{ .Release.Namespace }}.svc + - name: COMMON_CONTROLLER_XDS_PORT + value: "18002" + command: ['sh', '-c', 'echo -e "Checking for the availability of common-controller deployment"; while ! nc -z $COMMON_CONTROLLER_HOST_NAME $COMMON_CONTROLLER_XDS_PORT; do sleep 1; printf "-"; done; echo -e " >> common-controller has started";'] securityContext: allowPrivilegeEscalation: false capabilities: @@ -88,6 +96,8 @@ spec: value : "18000" - name: COMMON_CONTROLLER_XDS_PORT value : "18002" + - name: COMMON_CONTROLLER_REST_PORT + value : "18003" - name: ENFORCER_LABEL value : default - name: ENFORCER_REGION From 4ffb370a1d52e1bffc65be00cc6b5fc5e7c4b8c9 Mon Sep 17 00:00:00 2001 From: tharindu1st Date: Wed, 15 Nov 2023 00:25:58 +0530 Subject: [PATCH 3/4] grpc streaming server implementatio --- .../wso2/discovery/apkmgt/application.proto | 51 - .../discovery/keymgt/key_manager_config.proto | 18 - .../discovery/keymgt/revoked_tokens.proto | 33 - .../service/apkmgt/applicationds.proto | 34 - .../discovery/service/apkmgt/eventds.proto | 18 + .../wso2/discovery/service/keymgt/kmds.proto | 22 - .../wso2/discovery/service/keymgt/rtds.proto | 38 - .../subscription/app_key_mapping_ds.proto | 18 - .../service/subscription/app_mapping_ds.proto | 34 - .../service/subscription/app_policy_ds.proto | 18 - .../service/subscription/appds.proto | 18 - .../discovery/service/subscription/sds.proto | 18 - .../service/subscription/sub_policy_ds.proto | 18 - .../discovery/subscription/application.proto | 19 +- .../application_key_mapping.proto | 2 +- .../application_key_mapping_list.proto | 33 - .../subscription/application_list.proto | 33 - .../subscription/application_policy.proto | 18 - .../application_policy_list.proto | 17 - .../subscription/applicationmapping.proto | 2 +- .../applicationmapping_list.proto | 33 - .../wso2/discovery/subscription/event.proto | 42 + .../discovery/subscription/subscription.proto | 2 +- .../subscription/subscription_list.proto | 33 - .../subscription/subscription_policy.proto | 25 - .../subscription_policy_list.proto | 17 - adapter/api/protogen.sh | 3 - .../wso2/discovery/apkmgt/application.pb.go | 439 ----- .../discovery/keymgt/key_manager_config.pb.go | 193 --- .../discovery/keymgt/revoked_tokens.pb.go | 179 -- .../service/apkmgt/applicationds.pb.go | 223 --- .../discovery/service/apkmgt/eventds.pb.go | 278 +++ .../wso2/discovery/service/keymgt/kmds.pb.go | 252 --- .../wso2/discovery/service/keymgt/rtds.pb.go | 268 --- .../subscription/app_key_mapping_ds.pb.go | 210 --- .../service/subscription/app_mapping_ds.pb.go | 226 --- .../service/subscription/app_policy_ds.pb.go | 209 --- .../service/subscription/appds.pb.go | 208 --- .../discovery/service/subscription/sds.pb.go | 208 --- .../service/subscription/sub_policy_ds.pb.go | 210 --- .../discovery/subscription/application.pb.go | 292 +--- .../application_key_mapping.pb.go | 14 +- .../application_key_mapping_list.pb.go | 183 -- .../subscription/application_list.pb.go | 180 -- .../subscription/application_policy.pb.go | 184 -- .../application_policy_list.pb.go | 166 -- .../subscription/applicationmapping.pb.go | 15 +- .../applicationmapping_list.pb.go | 182 -- .../wso2/discovery/subscription/event.pb.go | 267 +++ .../discovery/subscription/subscription.pb.go | 15 +- .../subscription/subscription_list.pb.go | 180 -- .../subscription/subscription_policy.pb.go | 258 --- .../subscription_policy_list.pb.go | 166 -- .../discovery/protocol/cache/v3/resource.go | 20 - .../commoncontroller/common_controller.go | 43 +- .../internal/cache/subscriptionDataStore.go | 121 ++ .../internal/operator/constant/constant.go | 15 + .../controllers/cp/application_controller.go | 28 +- .../cp/applicationmapping_controller.go | 22 +- .../controllers/cp/subscription_controller.go | 22 +- .../internal/operator/operator.go | 7 +- .../internal/server/event_server.go | 37 + .../utils/enforcer_connection_holder.go | 22 + .../internal/utils/event_utils.go | 199 +++ common-controller/internal/xds/server.go | 100 +- .../service/apkmgt/EventServiceProto.java | 58 + .../service/apkmgt/EventStreamService.java | 241 +++ .../apkmgt/EventStreamServiceGrpc.java | 296 ++++ .../discovery/service/apkmgt/Request.java | 557 ++++++ .../service/apkmgt/RequestOrBuilder.java | 21 + .../subscription/EventServiceProto.java | 58 + .../subscription/EventStreamService.java | 241 +++ .../subscription/EventStreamServiceGrpc.java | 296 ++++ .../service/subscription/Request.java | 557 ++++++ .../subscription/RequestOrBuilder.java | 21 + .../discovery/subscription/Application.java | 172 +- .../ApplicationKeyMappingProto.java | 8 +- .../subscription/ApplicationMappingProto.java | 8 +- .../subscription/ApplicationOrBuilder.java | 22 +- .../subscription/ApplicationProto.java | 59 +- .../discovery/subscription/Event.java | 1520 +++++++++++++++++ .../subscription/EventOrBuilder.java | 99 ++ .../discovery/subscription/EventProto.java | 73 + .../subscription/SubscriptionProto.java | 8 +- helm-charts/values.yaml | 8 +- 85 files changed, 5393 insertions(+), 5388 deletions(-) delete mode 100644 adapter/api/proto/wso2/discovery/apkmgt/application.proto delete mode 100644 adapter/api/proto/wso2/discovery/keymgt/key_manager_config.proto delete mode 100644 adapter/api/proto/wso2/discovery/keymgt/revoked_tokens.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/apkmgt/applicationds.proto create mode 100644 adapter/api/proto/wso2/discovery/service/apkmgt/eventds.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/keymgt/kmds.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/keymgt/rtds.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/subscription/app_key_mapping_ds.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/subscription/app_mapping_ds.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/subscription/app_policy_ds.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/subscription/appds.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/subscription/sds.proto delete mode 100644 adapter/api/proto/wso2/discovery/service/subscription/sub_policy_ds.proto delete mode 100644 adapter/api/proto/wso2/discovery/subscription/application_key_mapping_list.proto delete mode 100644 adapter/api/proto/wso2/discovery/subscription/application_list.proto delete mode 100644 adapter/api/proto/wso2/discovery/subscription/application_policy.proto delete mode 100644 adapter/api/proto/wso2/discovery/subscription/application_policy_list.proto delete mode 100644 adapter/api/proto/wso2/discovery/subscription/applicationmapping_list.proto create mode 100644 adapter/api/proto/wso2/discovery/subscription/event.proto delete mode 100644 adapter/api/proto/wso2/discovery/subscription/subscription_list.proto delete mode 100644 adapter/api/proto/wso2/discovery/subscription/subscription_policy.proto delete mode 100644 adapter/api/proto/wso2/discovery/subscription/subscription_policy_list.proto delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/apkmgt/application.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/keymgt/key_manager_config.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/keymgt/revoked_tokens.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/applicationds.pb.go create mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/keymgt/kmds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/keymgt/rtds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_key_mapping_ds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_mapping_ds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_policy_ds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/subscription/appds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/subscription/sds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/service/subscription/sub_policy_ds.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping_list.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/application_list.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/application_policy.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/application_policy_list.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping_list.pb.go create mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/event.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_list.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_policy.pb.go delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_policy_list.pb.go create mode 100644 common-controller/internal/cache/subscriptionDataStore.go create mode 100644 common-controller/internal/server/event_server.go create mode 100644 common-controller/internal/utils/enforcer_connection_holder.go create mode 100644 common-controller/internal/utils/event_utils.go create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventServiceProto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamService.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamServiceGrpc.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/Request.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/RequestOrBuilder.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventServiceProto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventStreamService.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventStreamServiceGrpc.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/Request.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/RequestOrBuilder.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Event.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventOrBuilder.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventProto.java diff --git a/adapter/api/proto/wso2/discovery/apkmgt/application.proto b/adapter/api/proto/wso2/discovery/apkmgt/application.proto deleted file mode 100644 index ca6166509..000000000 --- a/adapter/api/proto/wso2/discovery/apkmgt/application.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) 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. - -syntax = "proto3"; - -package wso2.discovery.apkmgt; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/apkmgtapplication;apkmgtapplication"; -option java_package = "org.wso2.apk.enforcer.discovery.apkmgt"; -option java_outer_classname = "ApkMgtApplicationProto"; -option java_multiple_files = false; - -// [#protodoc-title: ApplicationDetails] - -message Application { - string uuid = 1; - string name = 2; - string owner = 3; - map attributes = 4; - string subscriber = 5; - string organization = 6; - repeated Subscription subscriptions = 7; - repeated ConsumerKey consumerKeys = 8; -} - -message ConsumerKey { - string key = 1; - string keyManager = 2; -} - -message Subscription { - string uuid = 1; - string apiUuid = 2; - string policyId = 3; - string subscriptionStatus = 4; - string organization = 5; - string createdBy = 6; -} diff --git a/adapter/api/proto/wso2/discovery/keymgt/key_manager_config.proto b/adapter/api/proto/wso2/discovery/keymgt/key_manager_config.proto deleted file mode 100644 index 0889c472e..000000000 --- a/adapter/api/proto/wso2/discovery/keymgt/key_manager_config.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package wso2.discovery.keymgt; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/keymgt;keymgt"; -option java_package = "org.wso2.apk.enforcer.discovery.keymgt"; -option java_outer_classname = "KeyManagerConfigProto"; -option java_multiple_files = true; - - -// KeyManagerConfig model -message KeyManagerConfig { - string name = 1; - string type = 2; - bool enabled = 3; - string tenantDomain = 4; - string configuration = 5; -} diff --git a/adapter/api/proto/wso2/discovery/keymgt/revoked_tokens.proto b/adapter/api/proto/wso2/discovery/keymgt/revoked_tokens.proto deleted file mode 100644 index 7c503b18f..000000000 --- a/adapter/api/proto/wso2/discovery/keymgt/revoked_tokens.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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. - * - */ - -syntax = "proto3"; - -package wso2.discovery.keymgt; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/keymgt;keymgt"; -option java_package = "org.wso2.apk.enforcer.discovery.keymgt"; -option java_outer_classname = "RevokedTokensProto"; -option java_multiple_files = true; - -// [#protodoc-title: Config] - -// Enforcer config model -message RevokedToken { - string jti = 1; - int64 expirytime = 2; -} diff --git a/adapter/api/proto/wso2/discovery/service/apkmgt/applicationds.proto b/adapter/api/proto/wso2/discovery/service/apkmgt/applicationds.proto deleted file mode 100644 index fbac73b0c..000000000 --- a/adapter/api/proto/wso2/discovery/service/apkmgt/applicationds.proto +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) 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. - -syntax = "proto3"; - -package discovery.service.apkmgt; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/apkmgt"; -option java_package = "org.wso2.apk.enforcer.discovery.service.apkmgt"; -option java_outer_classname = "ApplicationDsProto"; -option java_multiple_files = false; -option java_generic_services = true; - -// [#protodoc-title: ApplicationDS] -service APKMgtDiscoveryService { - rpc StreamAPKMgtApplications(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } -} \ No newline at end of file diff --git a/adapter/api/proto/wso2/discovery/service/apkmgt/eventds.proto b/adapter/api/proto/wso2/discovery/service/apkmgt/eventds.proto new file mode 100644 index 000000000..9a2eeefa0 --- /dev/null +++ b/adapter/api/proto/wso2/discovery/service/apkmgt/eventds.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package discovery.service.apkmgt; + +import "wso2/discovery/subscription/event.proto"; +option go_package = "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt"; +option java_package = "org.wso2.apk.enforcer.discovery.service.apkmgt"; +option java_outer_classname = "EventServiceProto"; +option java_multiple_files = true; +option java_generic_services = true; + +// [#protodoc-title: EventStreamDS] +service EventStreamService { + rpc StreamEvents (Request) returns (stream wso2.discovery.subscription.Event) {} + } +message Request { + string event = 1; +} \ No newline at end of file diff --git a/adapter/api/proto/wso2/discovery/service/keymgt/kmds.proto b/adapter/api/proto/wso2/discovery/service/keymgt/kmds.proto deleted file mode 100644 index 4d462de35..000000000 --- a/adapter/api/proto/wso2/discovery/service/keymgt/kmds.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; - -package wso2.discovery.service.keymgt; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/keymgt"; -option java_package = "org.wso2.apk.enforcer.discovery.service.keymgt"; -option java_outer_classname = "KmdsProto"; -option java_multiple_files = true; -option java_generic_services = true; - -// [#protodoc-title: KMDS] -service KMDiscoveryService { - rpc StreamKeyManagers(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } - - rpc FetchKeyManagers(envoy.service.discovery.v3.DiscoveryRequest) - returns (envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/adapter/api/proto/wso2/discovery/service/keymgt/rtds.proto b/adapter/api/proto/wso2/discovery/service/keymgt/rtds.proto deleted file mode 100644 index 72b938a58..000000000 --- a/adapter/api/proto/wso2/discovery/service/keymgt/rtds.proto +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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. - * - */ - -syntax = "proto3"; - -package wso2.discovery.service.keymgt; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/keymgt"; -option java_package = "org.wso2.apk.enforcer.discovery.service.keymgt"; -option java_outer_classname = "RtdsProto"; -option java_multiple_files = true; -option java_generic_services = true; - -// [#protodoc-title: RTDS] -service RevokedTokenDiscoveryService { - rpc StreamTokens(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } - - rpc FetchTokens(envoy.service.discovery.v3.DiscoveryRequest) returns (envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/adapter/api/proto/wso2/discovery/service/subscription/app_key_mapping_ds.proto b/adapter/api/proto/wso2/discovery/service/subscription/app_key_mapping_ds.proto deleted file mode 100644 index c6fac0588..000000000 --- a/adapter/api/proto/wso2/discovery/service/subscription/app_key_mapping_ds.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package discovery.service.subscription; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.service.subscription"; -option java_outer_classname = "AppKeyMappingDSProto"; -option java_multiple_files = true; -option java_generic_services = true; - -// [#protodoc-title: AppKeyMappingDS] -service ApplicationKeyMappingDiscoveryService { - rpc StreamApplicationKeyMappings(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/adapter/api/proto/wso2/discovery/service/subscription/app_mapping_ds.proto b/adapter/api/proto/wso2/discovery/service/subscription/app_mapping_ds.proto deleted file mode 100644 index 54db7f5ba..000000000 --- a/adapter/api/proto/wso2/discovery/service/subscription/app_mapping_ds.proto +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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. - * - */ -syntax = "proto3"; - -package discovery.service.subscription; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.service.subscription"; -option java_outer_classname = "AppMappingDSProto"; -option java_multiple_files = true; -option java_generic_services = true; - -// [#protodoc-title: AppMappingDS] -service ApplicationMappingDiscoveryService { - rpc StreamApplicationMappings(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/adapter/api/proto/wso2/discovery/service/subscription/app_policy_ds.proto b/adapter/api/proto/wso2/discovery/service/subscription/app_policy_ds.proto deleted file mode 100644 index 242604613..000000000 --- a/adapter/api/proto/wso2/discovery/service/subscription/app_policy_ds.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package discovery.service.subscription; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.service.subscription"; -option java_outer_classname = "AppPolicyDSProto"; -option java_multiple_files = true; -option java_generic_services = true; - -// [#protodoc-title: AppPolicyDS] -service ApplicationPolicyDiscoveryService { - rpc StreamApplicationPolicies(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/adapter/api/proto/wso2/discovery/service/subscription/appds.proto b/adapter/api/proto/wso2/discovery/service/subscription/appds.proto deleted file mode 100644 index a95d6ed40..000000000 --- a/adapter/api/proto/wso2/discovery/service/subscription/appds.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package discovery.service.subscription; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.service.subscription"; -option java_outer_classname = "AppDSProto"; -option java_multiple_files = true; -option java_generic_services = true; - -// [#protodoc-title: AppDS] -service ApplicationDiscoveryService { - rpc StreamApplications(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/adapter/api/proto/wso2/discovery/service/subscription/sds.proto b/adapter/api/proto/wso2/discovery/service/subscription/sds.proto deleted file mode 100644 index ff2ede246..000000000 --- a/adapter/api/proto/wso2/discovery/service/subscription/sds.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package discovery.service.subscription; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.service.subscription"; -option java_outer_classname = "SdsProto"; -option java_multiple_files = true; -option java_generic_services = true; - -// [#protodoc-title: SDS] -service SubscriptionDiscoveryService { - rpc StreamSubscriptions(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/adapter/api/proto/wso2/discovery/service/subscription/sub_policy_ds.proto b/adapter/api/proto/wso2/discovery/service/subscription/sub_policy_ds.proto deleted file mode 100644 index f56dc2f0b..000000000 --- a/adapter/api/proto/wso2/discovery/service/subscription/sub_policy_ds.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package discovery.service.subscription; - -import "envoy/service/discovery/v3/discovery.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/service/subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.service.subscription"; -option java_outer_classname = "SubPolicyDSProto"; -option java_multiple_files = true; -option java_generic_services = true; - -// [#protodoc-title: SubPolicyDS] -service SubscriptionPolicyDiscoveryService { - rpc StreamSubscriptionPolicies(stream envoy.service.discovery.v3.DiscoveryRequest) - returns (stream envoy.service.discovery.v3.DiscoveryResponse) { - } -} diff --git a/adapter/api/proto/wso2/discovery/subscription/application.proto b/adapter/api/proto/wso2/discovery/subscription/application.proto index 86a15b7ed..6a3ea7e36 100644 --- a/adapter/api/proto/wso2/discovery/subscription/application.proto +++ b/adapter/api/proto/wso2/discovery/subscription/application.proto @@ -18,7 +18,7 @@ syntax = "proto3"; package wso2.discovery.subscription; -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; +option go_package = "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription"; option java_package = "org.wso2.apk.enforcer.discovery.subscription"; option java_outer_classname = "ApplicationProto"; option java_multiple_files = true; @@ -30,19 +30,6 @@ message Application { string uuid = 1; string name = 2; string owner = 3; - map attributes = 4; -} - -message SecuritySchemes { - OAuth2 oAuth2 = 1; -} - -message OAuth2 { - repeated Environment environments = 1; -} - -message Environment { - string envID = 1; - string applicationIdentifier = 2; - string keyType = 3; + string organization = 4; + map attributes = 5; } diff --git a/adapter/api/proto/wso2/discovery/subscription/application_key_mapping.proto b/adapter/api/proto/wso2/discovery/subscription/application_key_mapping.proto index 07a744805..03459771d 100644 --- a/adapter/api/proto/wso2/discovery/subscription/application_key_mapping.proto +++ b/adapter/api/proto/wso2/discovery/subscription/application_key_mapping.proto @@ -18,7 +18,7 @@ syntax = "proto3"; package wso2.discovery.subscription; -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; +option go_package = "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription"; option java_package = "org.wso2.apk.enforcer.discovery.subscription"; option java_outer_classname = "ApplicationKeyMappingProto"; option java_multiple_files = true; diff --git a/adapter/api/proto/wso2/discovery/subscription/application_key_mapping_list.proto b/adapter/api/proto/wso2/discovery/subscription/application_key_mapping_list.proto deleted file mode 100644 index 1a20ce78c..000000000 --- a/adapter/api/proto/wso2/discovery/subscription/application_key_mapping_list.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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. - * - */ -syntax = "proto3"; - -package wso2.discovery.subscription; - -import "wso2/discovery/subscription/application_key_mapping.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.subscription"; -option java_outer_classname = "ApplicationKeyMappingListProto"; -option java_multiple_files = true; - -// [#protodoc-title: ApplicationKeyMappingList] - -// ApplicationKeyMappingList data model -message ApplicationKeyMappingList { - repeated ApplicationKeyMapping list = 2; -} diff --git a/adapter/api/proto/wso2/discovery/subscription/application_list.proto b/adapter/api/proto/wso2/discovery/subscription/application_list.proto deleted file mode 100644 index 78c83bcce..000000000 --- a/adapter/api/proto/wso2/discovery/subscription/application_list.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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. - * - */ -syntax = "proto3"; - -package wso2.discovery.subscription; - -import "wso2/discovery/subscription/application.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.subscription"; -option java_outer_classname = "ApplicationListProto"; -option java_multiple_files = true; - -// [#protodoc-title: ApplicationList] - -// ApplicationList data model -message ApplicationList { - repeated Application list = 2; -} diff --git a/adapter/api/proto/wso2/discovery/subscription/application_policy.proto b/adapter/api/proto/wso2/discovery/subscription/application_policy.proto deleted file mode 100644 index b80f2d32d..000000000 --- a/adapter/api/proto/wso2/discovery/subscription/application_policy.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package wso2.discovery.subscription; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.subscription"; -option java_outer_classname = "ApplicationPolicyProto"; -option java_multiple_files = true; - -// [#protodoc-title: ApplicationPolicy] - -// ApplicationPolicy data model -message ApplicationPolicy { - int32 id = 1; - int32 tenantId = 2; - string name = 3; - string quotaType = 4; -} diff --git a/adapter/api/proto/wso2/discovery/subscription/application_policy_list.proto b/adapter/api/proto/wso2/discovery/subscription/application_policy_list.proto deleted file mode 100644 index 9a405e500..000000000 --- a/adapter/api/proto/wso2/discovery/subscription/application_policy_list.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package wso2.discovery.subscription; - -import "wso2/discovery/subscription/application_policy.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.subscription"; -option java_outer_classname = "ApplicationPolicyListProto"; -option java_multiple_files = true; - -// [#protodoc-title: ApplicationPolicyList] - -// ApplicationPolicyList data model -message ApplicationPolicyList { - repeated ApplicationPolicy list = 2; -} diff --git a/adapter/api/proto/wso2/discovery/subscription/applicationmapping.proto b/adapter/api/proto/wso2/discovery/subscription/applicationmapping.proto index 4930ab844..2c217c79e 100644 --- a/adapter/api/proto/wso2/discovery/subscription/applicationmapping.proto +++ b/adapter/api/proto/wso2/discovery/subscription/applicationmapping.proto @@ -18,7 +18,7 @@ syntax = "proto3"; package wso2.discovery.subscription; -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; +option go_package = "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription"; option java_package = "org.wso2.apk.enforcer.discovery.subscription"; option java_outer_classname = "ApplicationMappingProto"; option java_multiple_files = true; diff --git a/adapter/api/proto/wso2/discovery/subscription/applicationmapping_list.proto b/adapter/api/proto/wso2/discovery/subscription/applicationmapping_list.proto deleted file mode 100644 index 71a11668f..000000000 --- a/adapter/api/proto/wso2/discovery/subscription/applicationmapping_list.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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. - * - */ -syntax = "proto3"; - -package wso2.discovery.subscription; - -import "wso2/discovery/subscription/applicationmapping.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.subscription"; -option java_outer_classname = "ApplicationMappingListProto"; -option java_multiple_files = true; - -// [#protodoc-title: ApplicationMappingList] - -// ApplicationMappingList data model -message ApplicationMappingList { - repeated ApplicationMapping list = 2; -} diff --git a/adapter/api/proto/wso2/discovery/subscription/event.proto b/adapter/api/proto/wso2/discovery/subscription/event.proto new file mode 100644 index 000000000..542ed8a49 --- /dev/null +++ b/adapter/api/proto/wso2/discovery/subscription/event.proto @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * Licensed 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. + * + */ + syntax = "proto3"; + + package wso2.discovery.subscription; + + import "wso2/discovery/subscription/application.proto"; + import "wso2/discovery/subscription/applicationmapping.proto"; + import "wso2/discovery/subscription/application_key_mapping.proto"; + import "wso2/discovery/subscription/subscription.proto"; + option go_package = "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription"; + option java_package = "org.wso2.apk.enforcer.discovery.subscription"; + option java_outer_classname = "EventProto"; + option java_multiple_files = true; + + // [#protodoc-title: Event] + + // Event data model + message Event { + string uuid = 1; + int64 timeStamp = 2; + string type = 3; + Application application = 4; + ApplicationMapping applicationMapping = 5; + ApplicationKeyMapping applicationKeyMapping = 6; + Subscription subscription = 7; + } + \ No newline at end of file diff --git a/adapter/api/proto/wso2/discovery/subscription/subscription.proto b/adapter/api/proto/wso2/discovery/subscription/subscription.proto index 4051c8593..2f61bdfb3 100644 --- a/adapter/api/proto/wso2/discovery/subscription/subscription.proto +++ b/adapter/api/proto/wso2/discovery/subscription/subscription.proto @@ -18,7 +18,7 @@ syntax = "proto3"; package wso2.discovery.subscription; -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; +option go_package = "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription"; option java_package = "org.wso2.apk.enforcer.discovery.subscription"; option java_outer_classname = "SubscriptionProto"; option java_multiple_files = true; diff --git a/adapter/api/proto/wso2/discovery/subscription/subscription_list.proto b/adapter/api/proto/wso2/discovery/subscription/subscription_list.proto deleted file mode 100644 index a4575218e..000000000 --- a/adapter/api/proto/wso2/discovery/subscription/subscription_list.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * Licensed 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. - * - */ -syntax = "proto3"; - -package wso2.discovery.subscription; - -import "wso2/discovery/subscription/subscription.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.subscription"; -option java_outer_classname = "SubscriptionListProto"; -option java_multiple_files = true; - -// [#protodoc-title: SubscriptionList] - -// SubscriptionList data model -message SubscriptionList { - repeated Subscription list = 2; -} diff --git a/adapter/api/proto/wso2/discovery/subscription/subscription_policy.proto b/adapter/api/proto/wso2/discovery/subscription/subscription_policy.proto deleted file mode 100644 index e95160144..000000000 --- a/adapter/api/proto/wso2/discovery/subscription/subscription_policy.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package wso2.discovery.subscription; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.subscription"; -option java_outer_classname = "SubscriptionPolicyProto"; -option java_multiple_files = true; - -// [#protodoc-title: SubscriptionPolicy] - -// SubscriptionPolicy data model -message SubscriptionPolicy { - int32 id = 1; - int32 tenantId = 2; - string name = 3; - string quotaType = 4; - int32 graphQLMaxComplexity = 5; - int32 graphQLMaxDepth = 6; - int32 rateLimitCount = 7; - string rateLimitTimeUnit = 8; - bool stopOnQuotaReach = 9; - string tenantDomain = 10; - int64 timestamp = 11; -} diff --git a/adapter/api/proto/wso2/discovery/subscription/subscription_policy_list.proto b/adapter/api/proto/wso2/discovery/subscription/subscription_policy_list.proto deleted file mode 100644 index 93a059040..000000000 --- a/adapter/api/proto/wso2/discovery/subscription/subscription_policy_list.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package wso2.discovery.subscription; - -import "wso2/discovery/subscription/subscription_policy.proto"; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/subscription;subscription"; -option java_package = "org.wso2.apk.enforcer.discovery.subscription"; -option java_outer_classname = "SubscriptionPolicyListProto"; -option java_multiple_files = true; - -// [#protodoc-title: SubscriptionPolicyList] - -// SubscriptionPolicyList data model -message SubscriptionPolicyList { - repeated SubscriptionPolicy list = 2; -} diff --git a/adapter/api/protogen.sh b/adapter/api/protogen.sh index b457f0ff8..94163e088 100755 --- a/adapter/api/protogen.sh +++ b/adapter/api/protogen.sh @@ -56,9 +56,7 @@ printf " - ${GREEN}${BOLD}done${NC}\n" printf "protoc go messages" docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go --go-source-relative -i proto -i target/include/ -o target/gen/go -d proto/wso2/discovery/api/ docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go --go-source-relative -i proto -i target/include/ -o target/gen/go -d proto/wso2/discovery/config/enforcer/ -docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go --go-source-relative -i proto -i target/include/ -o target/gen/go -d proto/wso2/discovery/keymgt/ docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go --go-source-relative -i proto -i target/include/ -o target/gen/go -d proto/wso2/discovery/subscription/ -docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go --go-source-relative -i proto -i target/include/ -o target/gen/go -d proto/wso2/discovery/apkmgt/ printf " - ${GREEN}${BOLD}done${NC}\n" # map of proto imports for which we need to update the genrated import path @@ -70,7 +68,6 @@ import_map=Menvoy/service/discovery/v3/discovery.proto=github.com/envoyproxy/go- # generate code for go grpc services docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go -i proto -i target/include/ -o target/gen/go --go-package-map $import_map --go-source-relative -d proto/wso2/discovery/service/api docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go -i proto -i target/include/ -o target/gen/go --go-package-map $import_map --go-source-relative -d proto/wso2/discovery/service/config -docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go -i proto -i target/include/ -o target/gen/go --go-package-map $import_map --go-source-relative -d proto/wso2/discovery/service/keymgt docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go -i proto -i target/include/ -o target/gen/go --go-package-map $import_map --go-source-relative -d proto/wso2/discovery/service/subscription docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go -i proto -i target/include/ -o target/gen/go --go-package-map $import_map --go-source-relative -d proto/wso2/discovery/service/apkmgt docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go -i proto -i target/include/ -o target/gen/ws-go --go-source-relative -d proto/wso2/discovery/service/websocket diff --git a/adapter/pkg/discovery/api/wso2/discovery/apkmgt/application.pb.go b/adapter/pkg/discovery/api/wso2/discovery/apkmgt/application.pb.go deleted file mode 100644 index 1fc1de147..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/apkmgt/application.pb.go +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/apkmgt/application.proto - -package apkmgtapplication - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Application struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Subscriber string `protobuf:"bytes,5,opt,name=subscriber,proto3" json:"subscriber,omitempty"` - Organization string `protobuf:"bytes,6,opt,name=organization,proto3" json:"organization,omitempty"` - Subscriptions []*Subscription `protobuf:"bytes,7,rep,name=subscriptions,proto3" json:"subscriptions,omitempty"` - ConsumerKeys []*ConsumerKey `protobuf:"bytes,8,rep,name=consumerKeys,proto3" json:"consumerKeys,omitempty"` -} - -func (x *Application) Reset() { - *x = Application{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_apkmgt_application_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Application) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Application) ProtoMessage() {} - -func (x *Application) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_apkmgt_application_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Application.ProtoReflect.Descriptor instead. -func (*Application) Descriptor() ([]byte, []int) { - return file_wso2_discovery_apkmgt_application_proto_rawDescGZIP(), []int{0} -} - -func (x *Application) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *Application) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Application) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *Application) GetAttributes() map[string]string { - if x != nil { - return x.Attributes - } - return nil -} - -func (x *Application) GetSubscriber() string { - if x != nil { - return x.Subscriber - } - return "" -} - -func (x *Application) GetOrganization() string { - if x != nil { - return x.Organization - } - return "" -} - -func (x *Application) GetSubscriptions() []*Subscription { - if x != nil { - return x.Subscriptions - } - return nil -} - -func (x *Application) GetConsumerKeys() []*ConsumerKey { - if x != nil { - return x.ConsumerKeys - } - return nil -} - -type ConsumerKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - KeyManager string `protobuf:"bytes,2,opt,name=keyManager,proto3" json:"keyManager,omitempty"` -} - -func (x *ConsumerKey) Reset() { - *x = ConsumerKey{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_apkmgt_application_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConsumerKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConsumerKey) ProtoMessage() {} - -func (x *ConsumerKey) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_apkmgt_application_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConsumerKey.ProtoReflect.Descriptor instead. -func (*ConsumerKey) Descriptor() ([]byte, []int) { - return file_wso2_discovery_apkmgt_application_proto_rawDescGZIP(), []int{1} -} - -func (x *ConsumerKey) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ConsumerKey) GetKeyManager() string { - if x != nil { - return x.KeyManager - } - return "" -} - -type Subscription struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - ApiUuid string `protobuf:"bytes,2,opt,name=apiUuid,proto3" json:"apiUuid,omitempty"` - PolicyId string `protobuf:"bytes,3,opt,name=policyId,proto3" json:"policyId,omitempty"` - SubscriptionStatus string `protobuf:"bytes,4,opt,name=subscriptionStatus,proto3" json:"subscriptionStatus,omitempty"` - Organization string `protobuf:"bytes,5,opt,name=organization,proto3" json:"organization,omitempty"` - CreatedBy string `protobuf:"bytes,6,opt,name=createdBy,proto3" json:"createdBy,omitempty"` -} - -func (x *Subscription) Reset() { - *x = Subscription{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_apkmgt_application_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Subscription) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Subscription) ProtoMessage() {} - -func (x *Subscription) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_apkmgt_application_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Subscription.ProtoReflect.Descriptor instead. -func (*Subscription) Descriptor() ([]byte, []int) { - return file_wso2_discovery_apkmgt_application_proto_rawDescGZIP(), []int{2} -} - -func (x *Subscription) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *Subscription) GetApiUuid() string { - if x != nil { - return x.ApiUuid - } - return "" -} - -func (x *Subscription) GetPolicyId() string { - if x != nil { - return x.PolicyId - } - return "" -} - -func (x *Subscription) GetSubscriptionStatus() string { - if x != nil { - return x.SubscriptionStatus - } - return "" -} - -func (x *Subscription) GetOrganization() string { - if x != nil { - return x.Organization - } - return "" -} - -func (x *Subscription) GetCreatedBy() string { - if x != nil { - return x.CreatedBy - } - return "" -} - -var File_wso2_discovery_apkmgt_application_proto protoreflect.FileDescriptor - -var file_wso2_discovery_apkmgt_application_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x77, 0x73, 0x6f, 0x32, 0x2e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, - 0x22, 0xb5, 0x03, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x52, - 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x2e, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, - 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, - 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x61, - 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x46, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x4b, 0x65, 0x79, - 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x2e, - 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x52, 0x0c, 0x63, 0x6f, 0x6e, - 0x73, 0x75, 0x6d, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3f, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x73, - 0x75, 0x6d, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x6b, 0x65, 0x79, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6b, - 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x22, 0xca, 0x01, 0x0a, 0x0c, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x70, 0x69, 0x55, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x70, 0x69, 0x55, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x12, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x42, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x42, 0x9d, 0x01, 0x0a, 0x26, 0x6f, 0x72, 0x67, 0x2e, 0x77, - 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x61, 0x70, 0x6b, 0x6d, 0x67, - 0x74, 0x42, 0x16, 0x41, 0x70, 0x6b, 0x4d, 0x67, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x00, 0x5a, 0x59, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_apkmgt_application_proto_rawDescOnce sync.Once - file_wso2_discovery_apkmgt_application_proto_rawDescData = file_wso2_discovery_apkmgt_application_proto_rawDesc -) - -func file_wso2_discovery_apkmgt_application_proto_rawDescGZIP() []byte { - file_wso2_discovery_apkmgt_application_proto_rawDescOnce.Do(func() { - file_wso2_discovery_apkmgt_application_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_apkmgt_application_proto_rawDescData) - }) - return file_wso2_discovery_apkmgt_application_proto_rawDescData -} - -var file_wso2_discovery_apkmgt_application_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_wso2_discovery_apkmgt_application_proto_goTypes = []interface{}{ - (*Application)(nil), // 0: wso2.discovery.apkmgt.Application - (*ConsumerKey)(nil), // 1: wso2.discovery.apkmgt.ConsumerKey - (*Subscription)(nil), // 2: wso2.discovery.apkmgt.Subscription - nil, // 3: wso2.discovery.apkmgt.Application.AttributesEntry -} -var file_wso2_discovery_apkmgt_application_proto_depIdxs = []int32{ - 3, // 0: wso2.discovery.apkmgt.Application.attributes:type_name -> wso2.discovery.apkmgt.Application.AttributesEntry - 2, // 1: wso2.discovery.apkmgt.Application.subscriptions:type_name -> wso2.discovery.apkmgt.Subscription - 1, // 2: wso2.discovery.apkmgt.Application.consumerKeys:type_name -> wso2.discovery.apkmgt.ConsumerKey - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_apkmgt_application_proto_init() } -func file_wso2_discovery_apkmgt_application_proto_init() { - if File_wso2_discovery_apkmgt_application_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_apkmgt_application_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Application); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wso2_discovery_apkmgt_application_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConsumerKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wso2_discovery_apkmgt_application_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Subscription); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_apkmgt_application_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_apkmgt_application_proto_goTypes, - DependencyIndexes: file_wso2_discovery_apkmgt_application_proto_depIdxs, - MessageInfos: file_wso2_discovery_apkmgt_application_proto_msgTypes, - }.Build() - File_wso2_discovery_apkmgt_application_proto = out.File - file_wso2_discovery_apkmgt_application_proto_rawDesc = nil - file_wso2_discovery_apkmgt_application_proto_goTypes = nil - file_wso2_discovery_apkmgt_application_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/keymgt/key_manager_config.pb.go b/adapter/pkg/discovery/api/wso2/discovery/keymgt/key_manager_config.pb.go deleted file mode 100644 index bbd1ddde2..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/keymgt/key_manager_config.pb.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/keymgt/key_manager_config.proto - -package keymgt - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// KeyManagerConfig model -type KeyManagerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` - TenantDomain string `protobuf:"bytes,4,opt,name=tenantDomain,proto3" json:"tenantDomain,omitempty"` - Configuration string `protobuf:"bytes,5,opt,name=configuration,proto3" json:"configuration,omitempty"` -} - -func (x *KeyManagerConfig) Reset() { - *x = KeyManagerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_keymgt_key_manager_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyManagerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyManagerConfig) ProtoMessage() {} - -func (x *KeyManagerConfig) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_keymgt_key_manager_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KeyManagerConfig.ProtoReflect.Descriptor instead. -func (*KeyManagerConfig) Descriptor() ([]byte, []int) { - return file_wso2_discovery_keymgt_key_manager_config_proto_rawDescGZIP(), []int{0} -} - -func (x *KeyManagerConfig) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *KeyManagerConfig) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *KeyManagerConfig) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *KeyManagerConfig) GetTenantDomain() string { - if x != nil { - return x.TenantDomain - } - return "" -} - -func (x *KeyManagerConfig) GetConfiguration() string { - if x != nil { - return x.Configuration - } - return "" -} - -var File_wso2_discovery_keymgt_key_manager_config_proto protoreflect.FileDescriptor - -var file_wso2_discovery_keymgt_key_manager_config_proto_rawDesc = []byte{ - 0x0a, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x15, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x10, 0x4b, 0x65, 0x79, 0x4d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x22, - 0x0a, 0x0c, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x86, 0x01, 0x0a, 0x26, 0x6f, 0x72, 0x67, - 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, - 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x6b, 0x65, 0x79, - 0x6d, 0x67, 0x74, 0x42, 0x15, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x3b, 0x6b, 0x65, 0x79, 0x6d, 0x67, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_keymgt_key_manager_config_proto_rawDescOnce sync.Once - file_wso2_discovery_keymgt_key_manager_config_proto_rawDescData = file_wso2_discovery_keymgt_key_manager_config_proto_rawDesc -) - -func file_wso2_discovery_keymgt_key_manager_config_proto_rawDescGZIP() []byte { - file_wso2_discovery_keymgt_key_manager_config_proto_rawDescOnce.Do(func() { - file_wso2_discovery_keymgt_key_manager_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_keymgt_key_manager_config_proto_rawDescData) - }) - return file_wso2_discovery_keymgt_key_manager_config_proto_rawDescData -} - -var file_wso2_discovery_keymgt_key_manager_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_keymgt_key_manager_config_proto_goTypes = []interface{}{ - (*KeyManagerConfig)(nil), // 0: wso2.discovery.keymgt.KeyManagerConfig -} -var file_wso2_discovery_keymgt_key_manager_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_keymgt_key_manager_config_proto_init() } -func file_wso2_discovery_keymgt_key_manager_config_proto_init() { - if File_wso2_discovery_keymgt_key_manager_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_keymgt_key_manager_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyManagerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_keymgt_key_manager_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_keymgt_key_manager_config_proto_goTypes, - DependencyIndexes: file_wso2_discovery_keymgt_key_manager_config_proto_depIdxs, - MessageInfos: file_wso2_discovery_keymgt_key_manager_config_proto_msgTypes, - }.Build() - File_wso2_discovery_keymgt_key_manager_config_proto = out.File - file_wso2_discovery_keymgt_key_manager_config_proto_rawDesc = nil - file_wso2_discovery_keymgt_key_manager_config_proto_goTypes = nil - file_wso2_discovery_keymgt_key_manager_config_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/keymgt/revoked_tokens.pb.go b/adapter/pkg/discovery/api/wso2/discovery/keymgt/revoked_tokens.pb.go deleted file mode 100644 index 903cbb452..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/keymgt/revoked_tokens.pb.go +++ /dev/null @@ -1,179 +0,0 @@ -// -// Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// Licensed 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/keymgt/revoked_tokens.proto - -package keymgt - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Enforcer config model -type RevokedToken struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Jti string `protobuf:"bytes,1,opt,name=jti,proto3" json:"jti,omitempty"` - Expirytime int64 `protobuf:"varint,2,opt,name=expirytime,proto3" json:"expirytime,omitempty"` -} - -func (x *RevokedToken) Reset() { - *x = RevokedToken{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_keymgt_revoked_tokens_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RevokedToken) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RevokedToken) ProtoMessage() {} - -func (x *RevokedToken) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_keymgt_revoked_tokens_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RevokedToken.ProtoReflect.Descriptor instead. -func (*RevokedToken) Descriptor() ([]byte, []int) { - return file_wso2_discovery_keymgt_revoked_tokens_proto_rawDescGZIP(), []int{0} -} - -func (x *RevokedToken) GetJti() string { - if x != nil { - return x.Jti - } - return "" -} - -func (x *RevokedToken) GetExpirytime() int64 { - if x != nil { - return x.Expirytime - } - return 0 -} - -var File_wso2_discovery_keymgt_revoked_tokens_proto protoreflect.FileDescriptor - -var file_wso2_discovery_keymgt_revoked_tokens_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x2f, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x77, 0x73, - 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x6b, 0x65, 0x79, - 0x6d, 0x67, 0x74, 0x22, 0x40, 0x0a, 0x0c, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x74, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6a, 0x74, 0x69, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x79, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x83, 0x01, 0x0a, 0x26, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, - 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, - 0x42, 0x12, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, - 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, - 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x6b, 0x65, - 0x79, 0x6d, 0x67, 0x74, 0x3b, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_keymgt_revoked_tokens_proto_rawDescOnce sync.Once - file_wso2_discovery_keymgt_revoked_tokens_proto_rawDescData = file_wso2_discovery_keymgt_revoked_tokens_proto_rawDesc -) - -func file_wso2_discovery_keymgt_revoked_tokens_proto_rawDescGZIP() []byte { - file_wso2_discovery_keymgt_revoked_tokens_proto_rawDescOnce.Do(func() { - file_wso2_discovery_keymgt_revoked_tokens_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_keymgt_revoked_tokens_proto_rawDescData) - }) - return file_wso2_discovery_keymgt_revoked_tokens_proto_rawDescData -} - -var file_wso2_discovery_keymgt_revoked_tokens_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_keymgt_revoked_tokens_proto_goTypes = []interface{}{ - (*RevokedToken)(nil), // 0: wso2.discovery.keymgt.RevokedToken -} -var file_wso2_discovery_keymgt_revoked_tokens_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_keymgt_revoked_tokens_proto_init() } -func file_wso2_discovery_keymgt_revoked_tokens_proto_init() { - if File_wso2_discovery_keymgt_revoked_tokens_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_keymgt_revoked_tokens_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RevokedToken); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_keymgt_revoked_tokens_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_keymgt_revoked_tokens_proto_goTypes, - DependencyIndexes: file_wso2_discovery_keymgt_revoked_tokens_proto_depIdxs, - MessageInfos: file_wso2_discovery_keymgt_revoked_tokens_proto_msgTypes, - }.Build() - File_wso2_discovery_keymgt_revoked_tokens_proto = out.File - file_wso2_discovery_keymgt_revoked_tokens_proto_rawDesc = nil - file_wso2_discovery_keymgt_revoked_tokens_proto_goTypes = nil - file_wso2_discovery_keymgt_revoked_tokens_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/applicationds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/applicationds.pb.go deleted file mode 100644 index 708b5cd91..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/applicationds.pb.go +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/apkmgt/applicationds.proto - -package apkmgt - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_apkmgt_applicationds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_apkmgt_applicationds_proto_rawDesc = []byte{ - 0x0a, 0x31, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x2f, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x1a, 0x2a, 0x65, - 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x97, 0x01, 0x0a, 0x16, 0x41, 0x50, - 0x4b, 0x4d, 0x67, 0x74, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x18, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x41, 0x50, - 0x4b, 0x4d, 0x67, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, - 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, - 0x01, 0x30, 0x01, 0x42, 0x8f, 0x01, 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, - 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x42, 0x12, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x00, 0x5a, 0x44, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x70, 0x6b, 0x6d, - 0x67, 0x74, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_wso2_discovery_service_apkmgt_applicationds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_apkmgt_applicationds_proto_depIdxs = []int32{ - 0, // 0: discovery.service.apkmgt.APKMgtDiscoveryService.StreamAPKMgtApplications:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 1: discovery.service.apkmgt.APKMgtDiscoveryService.StreamAPKMgtApplications:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_apkmgt_applicationds_proto_init() } -func file_wso2_discovery_service_apkmgt_applicationds_proto_init() { - if File_wso2_discovery_service_apkmgt_applicationds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_apkmgt_applicationds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_apkmgt_applicationds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_apkmgt_applicationds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_apkmgt_applicationds_proto = out.File - file_wso2_discovery_service_apkmgt_applicationds_proto_rawDesc = nil - file_wso2_discovery_service_apkmgt_applicationds_proto_goTypes = nil - file_wso2_discovery_service_apkmgt_applicationds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// APKMgtDiscoveryServiceClient is the client API for APKMgtDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type APKMgtDiscoveryServiceClient interface { - StreamAPKMgtApplications(ctx context.Context, opts ...grpc.CallOption) (APKMgtDiscoveryService_StreamAPKMgtApplicationsClient, error) -} - -type aPKMgtDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAPKMgtDiscoveryServiceClient(cc grpc.ClientConnInterface) APKMgtDiscoveryServiceClient { - return &aPKMgtDiscoveryServiceClient{cc} -} - -func (c *aPKMgtDiscoveryServiceClient) StreamAPKMgtApplications(ctx context.Context, opts ...grpc.CallOption) (APKMgtDiscoveryService_StreamAPKMgtApplicationsClient, error) { - stream, err := c.cc.NewStream(ctx, &_APKMgtDiscoveryService_serviceDesc.Streams[0], "/discovery.service.apkmgt.APKMgtDiscoveryService/StreamAPKMgtApplications", opts...) - if err != nil { - return nil, err - } - x := &aPKMgtDiscoveryServiceStreamAPKMgtApplicationsClient{stream} - return x, nil -} - -type APKMgtDiscoveryService_StreamAPKMgtApplicationsClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type aPKMgtDiscoveryServiceStreamAPKMgtApplicationsClient struct { - grpc.ClientStream -} - -func (x *aPKMgtDiscoveryServiceStreamAPKMgtApplicationsClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *aPKMgtDiscoveryServiceStreamAPKMgtApplicationsClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// APKMgtDiscoveryServiceServer is the server API for APKMgtDiscoveryService service. -type APKMgtDiscoveryServiceServer interface { - StreamAPKMgtApplications(APKMgtDiscoveryService_StreamAPKMgtApplicationsServer) error -} - -// UnimplementedAPKMgtDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedAPKMgtDiscoveryServiceServer struct { -} - -func (*UnimplementedAPKMgtDiscoveryServiceServer) StreamAPKMgtApplications(APKMgtDiscoveryService_StreamAPKMgtApplicationsServer) error { - return status.Errorf(codes.Unimplemented, "method StreamAPKMgtApplications not implemented") -} - -func RegisterAPKMgtDiscoveryServiceServer(s *grpc.Server, srv APKMgtDiscoveryServiceServer) { - s.RegisterService(&_APKMgtDiscoveryService_serviceDesc, srv) -} - -func _APKMgtDiscoveryService_StreamAPKMgtApplications_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(APKMgtDiscoveryServiceServer).StreamAPKMgtApplications(&aPKMgtDiscoveryServiceStreamAPKMgtApplicationsServer{stream}) -} - -type APKMgtDiscoveryService_StreamAPKMgtApplicationsServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type aPKMgtDiscoveryServiceStreamAPKMgtApplicationsServer struct { - grpc.ServerStream -} - -func (x *aPKMgtDiscoveryServiceStreamAPKMgtApplicationsServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *aPKMgtDiscoveryServiceStreamAPKMgtApplicationsServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _APKMgtDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "discovery.service.apkmgt.APKMgtDiscoveryService", - HandlerType: (*APKMgtDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamAPKMgtApplications", - Handler: _APKMgtDiscoveryService_StreamAPKMgtApplications_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/apkmgt/applicationds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go new file mode 100644 index 000000000..44197804a --- /dev/null +++ b/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go @@ -0,0 +1,278 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.13.0 +// source: wso2/discovery/service/apkmgt/eventds.proto + +package apkmgt + +import ( + context "context" + subscription "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` +} + +func (x *Request) Reset() { + *x = Request{} + if protoimpl.UnsafeEnabled { + mi := &file_wso2_discovery_service_apkmgt_eventds_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Request) ProtoMessage() {} + +func (x *Request) ProtoReflect() protoreflect.Message { + mi := &file_wso2_discovery_service_apkmgt_eventds_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Request.ProtoReflect.Descriptor instead. +func (*Request) Descriptor() ([]byte, []int) { + return file_wso2_discovery_service_apkmgt_eventds_proto_rawDescGZIP(), []int{0} +} + +func (x *Request) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +var File_wso2_discovery_service_apkmgt_eventds_proto protoreflect.FileDescriptor + +var file_wso2_discovery_service_apkmgt_eventds_proto_rawDesc = []byte{ + 0x0a, 0x2b, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x2f, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x1a, 0x27, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x1f, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x32, 0x6f, 0x0a, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x59, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x70, 0x6b, 0x6d, + 0x67, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x77, 0x73, 0x6f, + 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x00, + 0x30, 0x01, 0x42, 0x95, 0x01, 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, + 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, + 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x42, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, 0x2f, + 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x61, 0x70, 0x6b, 0x6d, 0x67, 0x74, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_wso2_discovery_service_apkmgt_eventds_proto_rawDescOnce sync.Once + file_wso2_discovery_service_apkmgt_eventds_proto_rawDescData = file_wso2_discovery_service_apkmgt_eventds_proto_rawDesc +) + +func file_wso2_discovery_service_apkmgt_eventds_proto_rawDescGZIP() []byte { + file_wso2_discovery_service_apkmgt_eventds_proto_rawDescOnce.Do(func() { + file_wso2_discovery_service_apkmgt_eventds_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_service_apkmgt_eventds_proto_rawDescData) + }) + return file_wso2_discovery_service_apkmgt_eventds_proto_rawDescData +} + +var file_wso2_discovery_service_apkmgt_eventds_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_wso2_discovery_service_apkmgt_eventds_proto_goTypes = []interface{}{ + (*Request)(nil), // 0: discovery.service.apkmgt.Request + (*subscription.Event)(nil), // 1: wso2.discovery.subscription.Event +} +var file_wso2_discovery_service_apkmgt_eventds_proto_depIdxs = []int32{ + 0, // 0: discovery.service.apkmgt.EventStreamService.StreamEvents:input_type -> discovery.service.apkmgt.Request + 1, // 1: discovery.service.apkmgt.EventStreamService.StreamEvents:output_type -> wso2.discovery.subscription.Event + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_wso2_discovery_service_apkmgt_eventds_proto_init() } +func file_wso2_discovery_service_apkmgt_eventds_proto_init() { + if File_wso2_discovery_service_apkmgt_eventds_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_wso2_discovery_service_apkmgt_eventds_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_wso2_discovery_service_apkmgt_eventds_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_wso2_discovery_service_apkmgt_eventds_proto_goTypes, + DependencyIndexes: file_wso2_discovery_service_apkmgt_eventds_proto_depIdxs, + MessageInfos: file_wso2_discovery_service_apkmgt_eventds_proto_msgTypes, + }.Build() + File_wso2_discovery_service_apkmgt_eventds_proto = out.File + file_wso2_discovery_service_apkmgt_eventds_proto_rawDesc = nil + file_wso2_discovery_service_apkmgt_eventds_proto_goTypes = nil + file_wso2_discovery_service_apkmgt_eventds_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// EventStreamServiceClient is the client API for EventStreamService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type EventStreamServiceClient interface { + StreamEvents(ctx context.Context, in *Request, opts ...grpc.CallOption) (EventStreamService_StreamEventsClient, error) +} + +type eventStreamServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEventStreamServiceClient(cc grpc.ClientConnInterface) EventStreamServiceClient { + return &eventStreamServiceClient{cc} +} + +func (c *eventStreamServiceClient) StreamEvents(ctx context.Context, in *Request, opts ...grpc.CallOption) (EventStreamService_StreamEventsClient, error) { + stream, err := c.cc.NewStream(ctx, &_EventStreamService_serviceDesc.Streams[0], "/discovery.service.apkmgt.EventStreamService/StreamEvents", opts...) + if err != nil { + return nil, err + } + x := &eventStreamServiceStreamEventsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type EventStreamService_StreamEventsClient interface { + Recv() (*subscription.Event, error) + grpc.ClientStream +} + +type eventStreamServiceStreamEventsClient struct { + grpc.ClientStream +} + +func (x *eventStreamServiceStreamEventsClient) Recv() (*subscription.Event, error) { + m := new(subscription.Event) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// EventStreamServiceServer is the server API for EventStreamService service. +type EventStreamServiceServer interface { + StreamEvents(*Request, EventStreamService_StreamEventsServer) error +} + +// UnimplementedEventStreamServiceServer can be embedded to have forward compatible implementations. +type UnimplementedEventStreamServiceServer struct { +} + +func (*UnimplementedEventStreamServiceServer) StreamEvents(*Request, EventStreamService_StreamEventsServer) error { + return status.Errorf(codes.Unimplemented, "method StreamEvents not implemented") +} + +func RegisterEventStreamServiceServer(s *grpc.Server, srv EventStreamServiceServer) { + s.RegisterService(&_EventStreamService_serviceDesc, srv) +} + +func _EventStreamService_StreamEvents_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Request) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(EventStreamServiceServer).StreamEvents(m, &eventStreamServiceStreamEventsServer{stream}) +} + +type EventStreamService_StreamEventsServer interface { + Send(*subscription.Event) error + grpc.ServerStream +} + +type eventStreamServiceStreamEventsServer struct { + grpc.ServerStream +} + +func (x *eventStreamServiceStreamEventsServer) Send(m *subscription.Event) error { + return x.ServerStream.SendMsg(m) +} + +var _EventStreamService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "discovery.service.apkmgt.EventStreamService", + HandlerType: (*EventStreamServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamEvents", + Handler: _EventStreamService_StreamEvents_Handler, + ServerStreams: true, + }, + }, + Metadata: "wso2/discovery/service/apkmgt/eventds.proto", +} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/keymgt/kmds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/keymgt/kmds.pb.go deleted file mode 100644 index 903d027f3..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/keymgt/kmds.pb.go +++ /dev/null @@ -1,252 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/keymgt/kmds.proto - -package keymgt - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_keymgt_kmds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_keymgt_kmds_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x2f, - 0x6b, 0x6d, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x77, 0x73, 0x6f, 0x32, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x1a, 0x2a, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xff, 0x01, 0x0a, 0x12, 0x4b, 0x4d, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x11, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x28, 0x01, 0x30, 0x01, 0x12, 0x71, 0x0a, 0x10, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x86, 0x01, 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, - 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, - 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x42, 0x09, 0x4b, 0x6d, 0x64, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, - 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, - 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x88, 0x01, 0x01, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_wso2_discovery_service_keymgt_kmds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_keymgt_kmds_proto_depIdxs = []int32{ - 0, // 0: wso2.discovery.service.keymgt.KMDiscoveryService.StreamKeyManagers:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 0, // 1: wso2.discovery.service.keymgt.KMDiscoveryService.FetchKeyManagers:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 2: wso2.discovery.service.keymgt.KMDiscoveryService.StreamKeyManagers:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // 3: wso2.discovery.service.keymgt.KMDiscoveryService.FetchKeyManagers:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_keymgt_kmds_proto_init() } -func file_wso2_discovery_service_keymgt_kmds_proto_init() { - if File_wso2_discovery_service_keymgt_kmds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_keymgt_kmds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_keymgt_kmds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_keymgt_kmds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_keymgt_kmds_proto = out.File - file_wso2_discovery_service_keymgt_kmds_proto_rawDesc = nil - file_wso2_discovery_service_keymgt_kmds_proto_goTypes = nil - file_wso2_discovery_service_keymgt_kmds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// KMDiscoveryServiceClient is the client API for KMDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type KMDiscoveryServiceClient interface { - StreamKeyManagers(ctx context.Context, opts ...grpc.CallOption) (KMDiscoveryService_StreamKeyManagersClient, error) - FetchKeyManagers(ctx context.Context, in *v3.DiscoveryRequest, opts ...grpc.CallOption) (*v3.DiscoveryResponse, error) -} - -type kMDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewKMDiscoveryServiceClient(cc grpc.ClientConnInterface) KMDiscoveryServiceClient { - return &kMDiscoveryServiceClient{cc} -} - -func (c *kMDiscoveryServiceClient) StreamKeyManagers(ctx context.Context, opts ...grpc.CallOption) (KMDiscoveryService_StreamKeyManagersClient, error) { - stream, err := c.cc.NewStream(ctx, &_KMDiscoveryService_serviceDesc.Streams[0], "/wso2.discovery.service.keymgt.KMDiscoveryService/StreamKeyManagers", opts...) - if err != nil { - return nil, err - } - x := &kMDiscoveryServiceStreamKeyManagersClient{stream} - return x, nil -} - -type KMDiscoveryService_StreamKeyManagersClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type kMDiscoveryServiceStreamKeyManagersClient struct { - grpc.ClientStream -} - -func (x *kMDiscoveryServiceStreamKeyManagersClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kMDiscoveryServiceStreamKeyManagersClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kMDiscoveryServiceClient) FetchKeyManagers(ctx context.Context, in *v3.DiscoveryRequest, opts ...grpc.CallOption) (*v3.DiscoveryResponse, error) { - out := new(v3.DiscoveryResponse) - err := c.cc.Invoke(ctx, "/wso2.discovery.service.keymgt.KMDiscoveryService/FetchKeyManagers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// KMDiscoveryServiceServer is the server API for KMDiscoveryService service. -type KMDiscoveryServiceServer interface { - StreamKeyManagers(KMDiscoveryService_StreamKeyManagersServer) error - FetchKeyManagers(context.Context, *v3.DiscoveryRequest) (*v3.DiscoveryResponse, error) -} - -// UnimplementedKMDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedKMDiscoveryServiceServer struct { -} - -func (*UnimplementedKMDiscoveryServiceServer) StreamKeyManagers(KMDiscoveryService_StreamKeyManagersServer) error { - return status.Errorf(codes.Unimplemented, "method StreamKeyManagers not implemented") -} -func (*UnimplementedKMDiscoveryServiceServer) FetchKeyManagers(context.Context, *v3.DiscoveryRequest) (*v3.DiscoveryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FetchKeyManagers not implemented") -} - -func RegisterKMDiscoveryServiceServer(s *grpc.Server, srv KMDiscoveryServiceServer) { - s.RegisterService(&_KMDiscoveryService_serviceDesc, srv) -} - -func _KMDiscoveryService_StreamKeyManagers_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KMDiscoveryServiceServer).StreamKeyManagers(&kMDiscoveryServiceStreamKeyManagersServer{stream}) -} - -type KMDiscoveryService_StreamKeyManagersServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type kMDiscoveryServiceStreamKeyManagersServer struct { - grpc.ServerStream -} - -func (x *kMDiscoveryServiceStreamKeyManagersServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kMDiscoveryServiceStreamKeyManagersServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KMDiscoveryService_FetchKeyManagers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v3.DiscoveryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KMDiscoveryServiceServer).FetchKeyManagers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/wso2.discovery.service.keymgt.KMDiscoveryService/FetchKeyManagers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KMDiscoveryServiceServer).FetchKeyManagers(ctx, req.(*v3.DiscoveryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _KMDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "wso2.discovery.service.keymgt.KMDiscoveryService", - HandlerType: (*KMDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "FetchKeyManagers", - Handler: _KMDiscoveryService_FetchKeyManagers_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamKeyManagers", - Handler: _KMDiscoveryService_StreamKeyManagers_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/keymgt/kmds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/keymgt/rtds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/keymgt/rtds.pb.go deleted file mode 100644 index dda0491e4..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/keymgt/rtds.pb.go +++ /dev/null @@ -1,268 +0,0 @@ -// -// Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// Licensed 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/keymgt/rtds.proto - -package keymgt - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_keymgt_rtds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_keymgt_rtds_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x2f, - 0x72, 0x74, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x77, 0x73, 0x6f, 0x32, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x1a, 0x2a, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xff, 0x01, 0x0a, 0x1c, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, - 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x71, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x6c, 0x0a, 0x0b, 0x46, 0x65, 0x74, - 0x63, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x86, 0x01, 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, - 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, - 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x42, 0x09, 0x52, 0x74, 0x64, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, - 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, - 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x67, 0x74, 0x88, 0x01, 0x01, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_wso2_discovery_service_keymgt_rtds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_keymgt_rtds_proto_depIdxs = []int32{ - 0, // 0: wso2.discovery.service.keymgt.RevokedTokenDiscoveryService.StreamTokens:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 0, // 1: wso2.discovery.service.keymgt.RevokedTokenDiscoveryService.FetchTokens:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 2: wso2.discovery.service.keymgt.RevokedTokenDiscoveryService.StreamTokens:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // 3: wso2.discovery.service.keymgt.RevokedTokenDiscoveryService.FetchTokens:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_keymgt_rtds_proto_init() } -func file_wso2_discovery_service_keymgt_rtds_proto_init() { - if File_wso2_discovery_service_keymgt_rtds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_keymgt_rtds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_keymgt_rtds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_keymgt_rtds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_keymgt_rtds_proto = out.File - file_wso2_discovery_service_keymgt_rtds_proto_rawDesc = nil - file_wso2_discovery_service_keymgt_rtds_proto_goTypes = nil - file_wso2_discovery_service_keymgt_rtds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// RevokedTokenDiscoveryServiceClient is the client API for RevokedTokenDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RevokedTokenDiscoveryServiceClient interface { - StreamTokens(ctx context.Context, opts ...grpc.CallOption) (RevokedTokenDiscoveryService_StreamTokensClient, error) - FetchTokens(ctx context.Context, in *v3.DiscoveryRequest, opts ...grpc.CallOption) (*v3.DiscoveryResponse, error) -} - -type revokedTokenDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewRevokedTokenDiscoveryServiceClient(cc grpc.ClientConnInterface) RevokedTokenDiscoveryServiceClient { - return &revokedTokenDiscoveryServiceClient{cc} -} - -func (c *revokedTokenDiscoveryServiceClient) StreamTokens(ctx context.Context, opts ...grpc.CallOption) (RevokedTokenDiscoveryService_StreamTokensClient, error) { - stream, err := c.cc.NewStream(ctx, &_RevokedTokenDiscoveryService_serviceDesc.Streams[0], "/wso2.discovery.service.keymgt.RevokedTokenDiscoveryService/StreamTokens", opts...) - if err != nil { - return nil, err - } - x := &revokedTokenDiscoveryServiceStreamTokensClient{stream} - return x, nil -} - -type RevokedTokenDiscoveryService_StreamTokensClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type revokedTokenDiscoveryServiceStreamTokensClient struct { - grpc.ClientStream -} - -func (x *revokedTokenDiscoveryServiceStreamTokensClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *revokedTokenDiscoveryServiceStreamTokensClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *revokedTokenDiscoveryServiceClient) FetchTokens(ctx context.Context, in *v3.DiscoveryRequest, opts ...grpc.CallOption) (*v3.DiscoveryResponse, error) { - out := new(v3.DiscoveryResponse) - err := c.cc.Invoke(ctx, "/wso2.discovery.service.keymgt.RevokedTokenDiscoveryService/FetchTokens", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RevokedTokenDiscoveryServiceServer is the server API for RevokedTokenDiscoveryService service. -type RevokedTokenDiscoveryServiceServer interface { - StreamTokens(RevokedTokenDiscoveryService_StreamTokensServer) error - FetchTokens(context.Context, *v3.DiscoveryRequest) (*v3.DiscoveryResponse, error) -} - -// UnimplementedRevokedTokenDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedRevokedTokenDiscoveryServiceServer struct { -} - -func (*UnimplementedRevokedTokenDiscoveryServiceServer) StreamTokens(RevokedTokenDiscoveryService_StreamTokensServer) error { - return status.Errorf(codes.Unimplemented, "method StreamTokens not implemented") -} -func (*UnimplementedRevokedTokenDiscoveryServiceServer) FetchTokens(context.Context, *v3.DiscoveryRequest) (*v3.DiscoveryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FetchTokens not implemented") -} - -func RegisterRevokedTokenDiscoveryServiceServer(s *grpc.Server, srv RevokedTokenDiscoveryServiceServer) { - s.RegisterService(&_RevokedTokenDiscoveryService_serviceDesc, srv) -} - -func _RevokedTokenDiscoveryService_StreamTokens_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(RevokedTokenDiscoveryServiceServer).StreamTokens(&revokedTokenDiscoveryServiceStreamTokensServer{stream}) -} - -type RevokedTokenDiscoveryService_StreamTokensServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type revokedTokenDiscoveryServiceStreamTokensServer struct { - grpc.ServerStream -} - -func (x *revokedTokenDiscoveryServiceStreamTokensServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *revokedTokenDiscoveryServiceStreamTokensServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _RevokedTokenDiscoveryService_FetchTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v3.DiscoveryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RevokedTokenDiscoveryServiceServer).FetchTokens(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/wso2.discovery.service.keymgt.RevokedTokenDiscoveryService/FetchTokens", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RevokedTokenDiscoveryServiceServer).FetchTokens(ctx, req.(*v3.DiscoveryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RevokedTokenDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "wso2.discovery.service.keymgt.RevokedTokenDiscoveryService", - HandlerType: (*RevokedTokenDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "FetchTokens", - Handler: _RevokedTokenDiscoveryService_FetchTokens_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamTokens", - Handler: _RevokedTokenDiscoveryService_StreamTokens_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/keymgt/rtds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_key_mapping_ds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_key_mapping_ds.pb.go deleted file mode 100644 index d72ed0085..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_key_mapping_ds.pb.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/subscription/app_key_mapping_ds.proto - -package subscription - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_subscription_app_key_mapping_ds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_rawDesc = []byte{ - 0x0a, 0x3c, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2a, - 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xab, 0x01, 0x0a, 0x25, 0x41, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x1c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x41, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, - 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x9d, 0x01, 0x0a, 0x34, 0x6f, 0x72, 0x67, - 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, - 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x14, 0x41, 0x70, 0x70, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x44, 0x53, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_depIdxs = []int32{ - 0, // 0: discovery.service.subscription.ApplicationKeyMappingDiscoveryService.StreamApplicationKeyMappings:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 1: discovery.service.subscription.ApplicationKeyMappingDiscoveryService.StreamApplicationKeyMappings:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_init() } -func file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_init() { - if File_wso2_discovery_service_subscription_app_key_mapping_ds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_subscription_app_key_mapping_ds_proto = out.File - file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_rawDesc = nil - file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_goTypes = nil - file_wso2_discovery_service_subscription_app_key_mapping_ds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ApplicationKeyMappingDiscoveryServiceClient is the client API for ApplicationKeyMappingDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ApplicationKeyMappingDiscoveryServiceClient interface { - StreamApplicationKeyMappings(ctx context.Context, opts ...grpc.CallOption) (ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappingsClient, error) -} - -type applicationKeyMappingDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewApplicationKeyMappingDiscoveryServiceClient(cc grpc.ClientConnInterface) ApplicationKeyMappingDiscoveryServiceClient { - return &applicationKeyMappingDiscoveryServiceClient{cc} -} - -func (c *applicationKeyMappingDiscoveryServiceClient) StreamApplicationKeyMappings(ctx context.Context, opts ...grpc.CallOption) (ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappingsClient, error) { - stream, err := c.cc.NewStream(ctx, &_ApplicationKeyMappingDiscoveryService_serviceDesc.Streams[0], "/discovery.service.subscription.ApplicationKeyMappingDiscoveryService/StreamApplicationKeyMappings", opts...) - if err != nil { - return nil, err - } - x := &applicationKeyMappingDiscoveryServiceStreamApplicationKeyMappingsClient{stream} - return x, nil -} - -type ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappingsClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type applicationKeyMappingDiscoveryServiceStreamApplicationKeyMappingsClient struct { - grpc.ClientStream -} - -func (x *applicationKeyMappingDiscoveryServiceStreamApplicationKeyMappingsClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *applicationKeyMappingDiscoveryServiceStreamApplicationKeyMappingsClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ApplicationKeyMappingDiscoveryServiceServer is the server API for ApplicationKeyMappingDiscoveryService service. -type ApplicationKeyMappingDiscoveryServiceServer interface { - StreamApplicationKeyMappings(ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappingsServer) error -} - -// UnimplementedApplicationKeyMappingDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedApplicationKeyMappingDiscoveryServiceServer struct { -} - -func (*UnimplementedApplicationKeyMappingDiscoveryServiceServer) StreamApplicationKeyMappings(ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappingsServer) error { - return status.Errorf(codes.Unimplemented, "method StreamApplicationKeyMappings not implemented") -} - -func RegisterApplicationKeyMappingDiscoveryServiceServer(s *grpc.Server, srv ApplicationKeyMappingDiscoveryServiceServer) { - s.RegisterService(&_ApplicationKeyMappingDiscoveryService_serviceDesc, srv) -} - -func _ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappings_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ApplicationKeyMappingDiscoveryServiceServer).StreamApplicationKeyMappings(&applicationKeyMappingDiscoveryServiceStreamApplicationKeyMappingsServer{stream}) -} - -type ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappingsServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type applicationKeyMappingDiscoveryServiceStreamApplicationKeyMappingsServer struct { - grpc.ServerStream -} - -func (x *applicationKeyMappingDiscoveryServiceStreamApplicationKeyMappingsServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *applicationKeyMappingDiscoveryServiceStreamApplicationKeyMappingsServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _ApplicationKeyMappingDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "discovery.service.subscription.ApplicationKeyMappingDiscoveryService", - HandlerType: (*ApplicationKeyMappingDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamApplicationKeyMappings", - Handler: _ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappings_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/subscription/app_key_mapping_ds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_mapping_ds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_mapping_ds.pb.go deleted file mode 100644 index a4a61c43a..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_mapping_ds.pb.go +++ /dev/null @@ -1,226 +0,0 @@ -// -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// Licensed 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/subscription/app_mapping_ds.proto - -package subscription - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_subscription_app_mapping_ds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_subscription_app_mapping_ds_proto_rawDesc = []byte{ - 0x0a, 0x38, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x5f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2a, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xa4, 0x01, 0x0a, 0x22, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 0x0a, - 0x19, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x9a, 0x01, - 0x0a, 0x34, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, - 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0x41, 0x70, 0x70, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x44, 0x53, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var file_wso2_discovery_service_subscription_app_mapping_ds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_subscription_app_mapping_ds_proto_depIdxs = []int32{ - 0, // 0: discovery.service.subscription.ApplicationMappingDiscoveryService.StreamApplicationMappings:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 1: discovery.service.subscription.ApplicationMappingDiscoveryService.StreamApplicationMappings:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_subscription_app_mapping_ds_proto_init() } -func file_wso2_discovery_service_subscription_app_mapping_ds_proto_init() { - if File_wso2_discovery_service_subscription_app_mapping_ds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_subscription_app_mapping_ds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_subscription_app_mapping_ds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_subscription_app_mapping_ds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_subscription_app_mapping_ds_proto = out.File - file_wso2_discovery_service_subscription_app_mapping_ds_proto_rawDesc = nil - file_wso2_discovery_service_subscription_app_mapping_ds_proto_goTypes = nil - file_wso2_discovery_service_subscription_app_mapping_ds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ApplicationMappingDiscoveryServiceClient is the client API for ApplicationMappingDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ApplicationMappingDiscoveryServiceClient interface { - StreamApplicationMappings(ctx context.Context, opts ...grpc.CallOption) (ApplicationMappingDiscoveryService_StreamApplicationMappingsClient, error) -} - -type applicationMappingDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewApplicationMappingDiscoveryServiceClient(cc grpc.ClientConnInterface) ApplicationMappingDiscoveryServiceClient { - return &applicationMappingDiscoveryServiceClient{cc} -} - -func (c *applicationMappingDiscoveryServiceClient) StreamApplicationMappings(ctx context.Context, opts ...grpc.CallOption) (ApplicationMappingDiscoveryService_StreamApplicationMappingsClient, error) { - stream, err := c.cc.NewStream(ctx, &_ApplicationMappingDiscoveryService_serviceDesc.Streams[0], "/discovery.service.subscription.ApplicationMappingDiscoveryService/StreamApplicationMappings", opts...) - if err != nil { - return nil, err - } - x := &applicationMappingDiscoveryServiceStreamApplicationMappingsClient{stream} - return x, nil -} - -type ApplicationMappingDiscoveryService_StreamApplicationMappingsClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type applicationMappingDiscoveryServiceStreamApplicationMappingsClient struct { - grpc.ClientStream -} - -func (x *applicationMappingDiscoveryServiceStreamApplicationMappingsClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *applicationMappingDiscoveryServiceStreamApplicationMappingsClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ApplicationMappingDiscoveryServiceServer is the server API for ApplicationMappingDiscoveryService service. -type ApplicationMappingDiscoveryServiceServer interface { - StreamApplicationMappings(ApplicationMappingDiscoveryService_StreamApplicationMappingsServer) error -} - -// UnimplementedApplicationMappingDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedApplicationMappingDiscoveryServiceServer struct { -} - -func (*UnimplementedApplicationMappingDiscoveryServiceServer) StreamApplicationMappings(ApplicationMappingDiscoveryService_StreamApplicationMappingsServer) error { - return status.Errorf(codes.Unimplemented, "method StreamApplicationMappings not implemented") -} - -func RegisterApplicationMappingDiscoveryServiceServer(s *grpc.Server, srv ApplicationMappingDiscoveryServiceServer) { - s.RegisterService(&_ApplicationMappingDiscoveryService_serviceDesc, srv) -} - -func _ApplicationMappingDiscoveryService_StreamApplicationMappings_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ApplicationMappingDiscoveryServiceServer).StreamApplicationMappings(&applicationMappingDiscoveryServiceStreamApplicationMappingsServer{stream}) -} - -type ApplicationMappingDiscoveryService_StreamApplicationMappingsServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type applicationMappingDiscoveryServiceStreamApplicationMappingsServer struct { - grpc.ServerStream -} - -func (x *applicationMappingDiscoveryServiceStreamApplicationMappingsServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *applicationMappingDiscoveryServiceStreamApplicationMappingsServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _ApplicationMappingDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "discovery.service.subscription.ApplicationMappingDiscoveryService", - HandlerType: (*ApplicationMappingDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamApplicationMappings", - Handler: _ApplicationMappingDiscoveryService_StreamApplicationMappings_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/subscription/app_mapping_ds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_policy_ds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_policy_ds.pb.go deleted file mode 100644 index c172e6a1d..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/app_policy_ds.pb.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/subscription/app_policy_ds.proto - -package subscription - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_subscription_app_policy_ds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_subscription_app_policy_ds_proto_rawDesc = []byte{ - 0x0a, 0x37, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x5f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2a, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xa3, 0x01, 0x0a, 0x21, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 0x0a, 0x19, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x99, 0x01, 0x0a, 0x34, - 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, - 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0x41, 0x70, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, - 0x53, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, - 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_wso2_discovery_service_subscription_app_policy_ds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_subscription_app_policy_ds_proto_depIdxs = []int32{ - 0, // 0: discovery.service.subscription.ApplicationPolicyDiscoveryService.StreamApplicationPolicies:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 1: discovery.service.subscription.ApplicationPolicyDiscoveryService.StreamApplicationPolicies:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_subscription_app_policy_ds_proto_init() } -func file_wso2_discovery_service_subscription_app_policy_ds_proto_init() { - if File_wso2_discovery_service_subscription_app_policy_ds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_subscription_app_policy_ds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_subscription_app_policy_ds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_subscription_app_policy_ds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_subscription_app_policy_ds_proto = out.File - file_wso2_discovery_service_subscription_app_policy_ds_proto_rawDesc = nil - file_wso2_discovery_service_subscription_app_policy_ds_proto_goTypes = nil - file_wso2_discovery_service_subscription_app_policy_ds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ApplicationPolicyDiscoveryServiceClient is the client API for ApplicationPolicyDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ApplicationPolicyDiscoveryServiceClient interface { - StreamApplicationPolicies(ctx context.Context, opts ...grpc.CallOption) (ApplicationPolicyDiscoveryService_StreamApplicationPoliciesClient, error) -} - -type applicationPolicyDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewApplicationPolicyDiscoveryServiceClient(cc grpc.ClientConnInterface) ApplicationPolicyDiscoveryServiceClient { - return &applicationPolicyDiscoveryServiceClient{cc} -} - -func (c *applicationPolicyDiscoveryServiceClient) StreamApplicationPolicies(ctx context.Context, opts ...grpc.CallOption) (ApplicationPolicyDiscoveryService_StreamApplicationPoliciesClient, error) { - stream, err := c.cc.NewStream(ctx, &_ApplicationPolicyDiscoveryService_serviceDesc.Streams[0], "/discovery.service.subscription.ApplicationPolicyDiscoveryService/StreamApplicationPolicies", opts...) - if err != nil { - return nil, err - } - x := &applicationPolicyDiscoveryServiceStreamApplicationPoliciesClient{stream} - return x, nil -} - -type ApplicationPolicyDiscoveryService_StreamApplicationPoliciesClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type applicationPolicyDiscoveryServiceStreamApplicationPoliciesClient struct { - grpc.ClientStream -} - -func (x *applicationPolicyDiscoveryServiceStreamApplicationPoliciesClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *applicationPolicyDiscoveryServiceStreamApplicationPoliciesClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ApplicationPolicyDiscoveryServiceServer is the server API for ApplicationPolicyDiscoveryService service. -type ApplicationPolicyDiscoveryServiceServer interface { - StreamApplicationPolicies(ApplicationPolicyDiscoveryService_StreamApplicationPoliciesServer) error -} - -// UnimplementedApplicationPolicyDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedApplicationPolicyDiscoveryServiceServer struct { -} - -func (*UnimplementedApplicationPolicyDiscoveryServiceServer) StreamApplicationPolicies(ApplicationPolicyDiscoveryService_StreamApplicationPoliciesServer) error { - return status.Errorf(codes.Unimplemented, "method StreamApplicationPolicies not implemented") -} - -func RegisterApplicationPolicyDiscoveryServiceServer(s *grpc.Server, srv ApplicationPolicyDiscoveryServiceServer) { - s.RegisterService(&_ApplicationPolicyDiscoveryService_serviceDesc, srv) -} - -func _ApplicationPolicyDiscoveryService_StreamApplicationPolicies_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ApplicationPolicyDiscoveryServiceServer).StreamApplicationPolicies(&applicationPolicyDiscoveryServiceStreamApplicationPoliciesServer{stream}) -} - -type ApplicationPolicyDiscoveryService_StreamApplicationPoliciesServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type applicationPolicyDiscoveryServiceStreamApplicationPoliciesServer struct { - grpc.ServerStream -} - -func (x *applicationPolicyDiscoveryServiceStreamApplicationPoliciesServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *applicationPolicyDiscoveryServiceStreamApplicationPoliciesServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _ApplicationPolicyDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "discovery.service.subscription.ApplicationPolicyDiscoveryService", - HandlerType: (*ApplicationPolicyDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamApplicationPolicies", - Handler: _ApplicationPolicyDiscoveryService_StreamApplicationPolicies_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/subscription/app_policy_ds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/appds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/subscription/appds.pb.go deleted file mode 100644 index aa2c7167a..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/appds.pb.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/subscription/appds.proto - -package subscription - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_subscription_appds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_subscription_appds_proto_rawDesc = []byte{ - 0x0a, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x1e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x1a, 0x2a, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x96, 0x01, - 0x0a, 0x1b, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x77, 0x0a, - 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, - 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x93, 0x01, 0x0a, 0x34, 0x6f, 0x72, 0x67, 0x2e, 0x77, - 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x0a, 0x41, 0x70, 0x70, 0x44, 0x53, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var file_wso2_discovery_service_subscription_appds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_subscription_appds_proto_depIdxs = []int32{ - 0, // 0: discovery.service.subscription.ApplicationDiscoveryService.StreamApplications:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 1: discovery.service.subscription.ApplicationDiscoveryService.StreamApplications:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_subscription_appds_proto_init() } -func file_wso2_discovery_service_subscription_appds_proto_init() { - if File_wso2_discovery_service_subscription_appds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_subscription_appds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_subscription_appds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_subscription_appds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_subscription_appds_proto = out.File - file_wso2_discovery_service_subscription_appds_proto_rawDesc = nil - file_wso2_discovery_service_subscription_appds_proto_goTypes = nil - file_wso2_discovery_service_subscription_appds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ApplicationDiscoveryServiceClient is the client API for ApplicationDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ApplicationDiscoveryServiceClient interface { - StreamApplications(ctx context.Context, opts ...grpc.CallOption) (ApplicationDiscoveryService_StreamApplicationsClient, error) -} - -type applicationDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewApplicationDiscoveryServiceClient(cc grpc.ClientConnInterface) ApplicationDiscoveryServiceClient { - return &applicationDiscoveryServiceClient{cc} -} - -func (c *applicationDiscoveryServiceClient) StreamApplications(ctx context.Context, opts ...grpc.CallOption) (ApplicationDiscoveryService_StreamApplicationsClient, error) { - stream, err := c.cc.NewStream(ctx, &_ApplicationDiscoveryService_serviceDesc.Streams[0], "/discovery.service.subscription.ApplicationDiscoveryService/StreamApplications", opts...) - if err != nil { - return nil, err - } - x := &applicationDiscoveryServiceStreamApplicationsClient{stream} - return x, nil -} - -type ApplicationDiscoveryService_StreamApplicationsClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type applicationDiscoveryServiceStreamApplicationsClient struct { - grpc.ClientStream -} - -func (x *applicationDiscoveryServiceStreamApplicationsClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *applicationDiscoveryServiceStreamApplicationsClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ApplicationDiscoveryServiceServer is the server API for ApplicationDiscoveryService service. -type ApplicationDiscoveryServiceServer interface { - StreamApplications(ApplicationDiscoveryService_StreamApplicationsServer) error -} - -// UnimplementedApplicationDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedApplicationDiscoveryServiceServer struct { -} - -func (*UnimplementedApplicationDiscoveryServiceServer) StreamApplications(ApplicationDiscoveryService_StreamApplicationsServer) error { - return status.Errorf(codes.Unimplemented, "method StreamApplications not implemented") -} - -func RegisterApplicationDiscoveryServiceServer(s *grpc.Server, srv ApplicationDiscoveryServiceServer) { - s.RegisterService(&_ApplicationDiscoveryService_serviceDesc, srv) -} - -func _ApplicationDiscoveryService_StreamApplications_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ApplicationDiscoveryServiceServer).StreamApplications(&applicationDiscoveryServiceStreamApplicationsServer{stream}) -} - -type ApplicationDiscoveryService_StreamApplicationsServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type applicationDiscoveryServiceStreamApplicationsServer struct { - grpc.ServerStream -} - -func (x *applicationDiscoveryServiceStreamApplicationsServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *applicationDiscoveryServiceStreamApplicationsServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _ApplicationDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "discovery.service.subscription.ApplicationDiscoveryService", - HandlerType: (*ApplicationDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamApplications", - Handler: _ApplicationDiscoveryService_StreamApplications_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/subscription/appds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/sds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/subscription/sds.pb.go deleted file mode 100644 index c30dde371..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/sds.pb.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/subscription/sds.proto - -package subscription - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_subscription_sds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_subscription_sds_proto_rawDesc = []byte{ - 0x0a, 0x2d, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x1e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x2a, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x98, 0x01, 0x0a, 0x1c, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x13, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, - 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x91, 0x01, 0x0a, 0x34, 0x6f, 0x72, 0x67, 0x2e, 0x77, - 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x08, 0x53, 0x64, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var file_wso2_discovery_service_subscription_sds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_subscription_sds_proto_depIdxs = []int32{ - 0, // 0: discovery.service.subscription.SubscriptionDiscoveryService.StreamSubscriptions:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 1: discovery.service.subscription.SubscriptionDiscoveryService.StreamSubscriptions:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_subscription_sds_proto_init() } -func file_wso2_discovery_service_subscription_sds_proto_init() { - if File_wso2_discovery_service_subscription_sds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_subscription_sds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_subscription_sds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_subscription_sds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_subscription_sds_proto = out.File - file_wso2_discovery_service_subscription_sds_proto_rawDesc = nil - file_wso2_discovery_service_subscription_sds_proto_goTypes = nil - file_wso2_discovery_service_subscription_sds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// SubscriptionDiscoveryServiceClient is the client API for SubscriptionDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SubscriptionDiscoveryServiceClient interface { - StreamSubscriptions(ctx context.Context, opts ...grpc.CallOption) (SubscriptionDiscoveryService_StreamSubscriptionsClient, error) -} - -type subscriptionDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewSubscriptionDiscoveryServiceClient(cc grpc.ClientConnInterface) SubscriptionDiscoveryServiceClient { - return &subscriptionDiscoveryServiceClient{cc} -} - -func (c *subscriptionDiscoveryServiceClient) StreamSubscriptions(ctx context.Context, opts ...grpc.CallOption) (SubscriptionDiscoveryService_StreamSubscriptionsClient, error) { - stream, err := c.cc.NewStream(ctx, &_SubscriptionDiscoveryService_serviceDesc.Streams[0], "/discovery.service.subscription.SubscriptionDiscoveryService/StreamSubscriptions", opts...) - if err != nil { - return nil, err - } - x := &subscriptionDiscoveryServiceStreamSubscriptionsClient{stream} - return x, nil -} - -type SubscriptionDiscoveryService_StreamSubscriptionsClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type subscriptionDiscoveryServiceStreamSubscriptionsClient struct { - grpc.ClientStream -} - -func (x *subscriptionDiscoveryServiceStreamSubscriptionsClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *subscriptionDiscoveryServiceStreamSubscriptionsClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// SubscriptionDiscoveryServiceServer is the server API for SubscriptionDiscoveryService service. -type SubscriptionDiscoveryServiceServer interface { - StreamSubscriptions(SubscriptionDiscoveryService_StreamSubscriptionsServer) error -} - -// UnimplementedSubscriptionDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedSubscriptionDiscoveryServiceServer struct { -} - -func (*UnimplementedSubscriptionDiscoveryServiceServer) StreamSubscriptions(SubscriptionDiscoveryService_StreamSubscriptionsServer) error { - return status.Errorf(codes.Unimplemented, "method StreamSubscriptions not implemented") -} - -func RegisterSubscriptionDiscoveryServiceServer(s *grpc.Server, srv SubscriptionDiscoveryServiceServer) { - s.RegisterService(&_SubscriptionDiscoveryService_serviceDesc, srv) -} - -func _SubscriptionDiscoveryService_StreamSubscriptions_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(SubscriptionDiscoveryServiceServer).StreamSubscriptions(&subscriptionDiscoveryServiceStreamSubscriptionsServer{stream}) -} - -type SubscriptionDiscoveryService_StreamSubscriptionsServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type subscriptionDiscoveryServiceStreamSubscriptionsServer struct { - grpc.ServerStream -} - -func (x *subscriptionDiscoveryServiceStreamSubscriptionsServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *subscriptionDiscoveryServiceStreamSubscriptionsServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _SubscriptionDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "discovery.service.subscription.SubscriptionDiscoveryService", - HandlerType: (*SubscriptionDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamSubscriptions", - Handler: _SubscriptionDiscoveryService_StreamSubscriptions_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/subscription/sds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/sub_policy_ds.pb.go b/adapter/pkg/discovery/api/wso2/discovery/service/subscription/sub_policy_ds.pb.go deleted file mode 100644 index 19bccad76..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/service/subscription/sub_policy_ds.pb.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/service/subscription/sub_policy_ds.proto - -package subscription - -import ( - context "context" - v3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_wso2_discovery_service_subscription_sub_policy_ds_proto protoreflect.FileDescriptor - -var file_wso2_discovery_service_subscription_sub_policy_ds_proto_rawDesc = []byte{ - 0x0a, 0x37, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x75, 0x62, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x5f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2a, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x76, 0x33, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xa5, 0x01, 0x0a, 0x22, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7f, 0x0a, 0x1a, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x99, 0x01, - 0x0a, 0x34, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, - 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0x53, 0x75, 0x62, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x44, 0x53, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var file_wso2_discovery_service_subscription_sub_policy_ds_proto_goTypes = []interface{}{ - (*v3.DiscoveryRequest)(nil), // 0: envoy.service.discovery.v3.DiscoveryRequest - (*v3.DiscoveryResponse)(nil), // 1: envoy.service.discovery.v3.DiscoveryResponse -} -var file_wso2_discovery_service_subscription_sub_policy_ds_proto_depIdxs = []int32{ - 0, // 0: discovery.service.subscription.SubscriptionPolicyDiscoveryService.StreamSubscriptionPolicies:input_type -> envoy.service.discovery.v3.DiscoveryRequest - 1, // 1: discovery.service.subscription.SubscriptionPolicyDiscoveryService.StreamSubscriptionPolicies:output_type -> envoy.service.discovery.v3.DiscoveryResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_service_subscription_sub_policy_ds_proto_init() } -func file_wso2_discovery_service_subscription_sub_policy_ds_proto_init() { - if File_wso2_discovery_service_subscription_sub_policy_ds_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_service_subscription_sub_policy_ds_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_wso2_discovery_service_subscription_sub_policy_ds_proto_goTypes, - DependencyIndexes: file_wso2_discovery_service_subscription_sub_policy_ds_proto_depIdxs, - }.Build() - File_wso2_discovery_service_subscription_sub_policy_ds_proto = out.File - file_wso2_discovery_service_subscription_sub_policy_ds_proto_rawDesc = nil - file_wso2_discovery_service_subscription_sub_policy_ds_proto_goTypes = nil - file_wso2_discovery_service_subscription_sub_policy_ds_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// SubscriptionPolicyDiscoveryServiceClient is the client API for SubscriptionPolicyDiscoveryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SubscriptionPolicyDiscoveryServiceClient interface { - StreamSubscriptionPolicies(ctx context.Context, opts ...grpc.CallOption) (SubscriptionPolicyDiscoveryService_StreamSubscriptionPoliciesClient, error) -} - -type subscriptionPolicyDiscoveryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewSubscriptionPolicyDiscoveryServiceClient(cc grpc.ClientConnInterface) SubscriptionPolicyDiscoveryServiceClient { - return &subscriptionPolicyDiscoveryServiceClient{cc} -} - -func (c *subscriptionPolicyDiscoveryServiceClient) StreamSubscriptionPolicies(ctx context.Context, opts ...grpc.CallOption) (SubscriptionPolicyDiscoveryService_StreamSubscriptionPoliciesClient, error) { - stream, err := c.cc.NewStream(ctx, &_SubscriptionPolicyDiscoveryService_serviceDesc.Streams[0], "/discovery.service.subscription.SubscriptionPolicyDiscoveryService/StreamSubscriptionPolicies", opts...) - if err != nil { - return nil, err - } - x := &subscriptionPolicyDiscoveryServiceStreamSubscriptionPoliciesClient{stream} - return x, nil -} - -type SubscriptionPolicyDiscoveryService_StreamSubscriptionPoliciesClient interface { - Send(*v3.DiscoveryRequest) error - Recv() (*v3.DiscoveryResponse, error) - grpc.ClientStream -} - -type subscriptionPolicyDiscoveryServiceStreamSubscriptionPoliciesClient struct { - grpc.ClientStream -} - -func (x *subscriptionPolicyDiscoveryServiceStreamSubscriptionPoliciesClient) Send(m *v3.DiscoveryRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *subscriptionPolicyDiscoveryServiceStreamSubscriptionPoliciesClient) Recv() (*v3.DiscoveryResponse, error) { - m := new(v3.DiscoveryResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// SubscriptionPolicyDiscoveryServiceServer is the server API for SubscriptionPolicyDiscoveryService service. -type SubscriptionPolicyDiscoveryServiceServer interface { - StreamSubscriptionPolicies(SubscriptionPolicyDiscoveryService_StreamSubscriptionPoliciesServer) error -} - -// UnimplementedSubscriptionPolicyDiscoveryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedSubscriptionPolicyDiscoveryServiceServer struct { -} - -func (*UnimplementedSubscriptionPolicyDiscoveryServiceServer) StreamSubscriptionPolicies(SubscriptionPolicyDiscoveryService_StreamSubscriptionPoliciesServer) error { - return status.Errorf(codes.Unimplemented, "method StreamSubscriptionPolicies not implemented") -} - -func RegisterSubscriptionPolicyDiscoveryServiceServer(s *grpc.Server, srv SubscriptionPolicyDiscoveryServiceServer) { - s.RegisterService(&_SubscriptionPolicyDiscoveryService_serviceDesc, srv) -} - -func _SubscriptionPolicyDiscoveryService_StreamSubscriptionPolicies_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(SubscriptionPolicyDiscoveryServiceServer).StreamSubscriptionPolicies(&subscriptionPolicyDiscoveryServiceStreamSubscriptionPoliciesServer{stream}) -} - -type SubscriptionPolicyDiscoveryService_StreamSubscriptionPoliciesServer interface { - Send(*v3.DiscoveryResponse) error - Recv() (*v3.DiscoveryRequest, error) - grpc.ServerStream -} - -type subscriptionPolicyDiscoveryServiceStreamSubscriptionPoliciesServer struct { - grpc.ServerStream -} - -func (x *subscriptionPolicyDiscoveryServiceStreamSubscriptionPoliciesServer) Send(m *v3.DiscoveryResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *subscriptionPolicyDiscoveryServiceStreamSubscriptionPoliciesServer) Recv() (*v3.DiscoveryRequest, error) { - m := new(v3.DiscoveryRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _SubscriptionPolicyDiscoveryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "discovery.service.subscription.SubscriptionPolicyDiscoveryService", - HandlerType: (*SubscriptionPolicyDiscoveryServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamSubscriptionPolicies", - Handler: _SubscriptionPolicyDiscoveryService_StreamSubscriptionPolicies_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "wso2/discovery/service/subscription/sub_policy_ds.proto", -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/application.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/application.pb.go index aeff003c2..e40dd74c2 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/application.pb.go +++ b/adapter/pkg/discovery/api/wso2/discovery/subscription/application.pb.go @@ -42,10 +42,11 @@ type Application struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` + Organization string `protobuf:"bytes,4,opt,name=organization,proto3" json:"organization,omitempty"` + Attributes map[string]string `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Application) Reset() { @@ -101,168 +102,18 @@ func (x *Application) GetOwner() string { return "" } -func (x *Application) GetAttributes() map[string]string { - if x != nil { - return x.Attributes - } - return nil -} - -type SecuritySchemes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OAuth2 *OAuth2 `protobuf:"bytes,1,opt,name=oAuth2,proto3" json:"oAuth2,omitempty"` -} - -func (x *SecuritySchemes) Reset() { - *x = SecuritySchemes{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_application_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecuritySchemes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecuritySchemes) ProtoMessage() {} - -func (x *SecuritySchemes) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_application_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecuritySchemes.ProtoReflect.Descriptor instead. -func (*SecuritySchemes) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_application_proto_rawDescGZIP(), []int{1} -} - -func (x *SecuritySchemes) GetOAuth2() *OAuth2 { - if x != nil { - return x.OAuth2 - } - return nil -} - -type OAuth2 struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Environments []*Environment `protobuf:"bytes,1,rep,name=environments,proto3" json:"environments,omitempty"` -} - -func (x *OAuth2) Reset() { - *x = OAuth2{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_application_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OAuth2) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OAuth2) ProtoMessage() {} - -func (x *OAuth2) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_application_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OAuth2.ProtoReflect.Descriptor instead. -func (*OAuth2) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_application_proto_rawDescGZIP(), []int{2} -} - -func (x *OAuth2) GetEnvironments() []*Environment { - if x != nil { - return x.Environments - } - return nil -} - -type Environment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EnvID string `protobuf:"bytes,1,opt,name=envID,proto3" json:"envID,omitempty"` - ApplicationIdentifier string `protobuf:"bytes,2,opt,name=applicationIdentifier,proto3" json:"applicationIdentifier,omitempty"` - KeyType string `protobuf:"bytes,3,opt,name=keyType,proto3" json:"keyType,omitempty"` -} - -func (x *Environment) Reset() { - *x = Environment{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_application_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Environment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Environment) ProtoMessage() {} - -func (x *Environment) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_application_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Environment.ProtoReflect.Descriptor instead. -func (*Environment) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_application_proto_rawDescGZIP(), []int{3} -} - -func (x *Environment) GetEnvID() string { - if x != nil { - return x.EnvID - } - return "" -} - -func (x *Environment) GetApplicationIdentifier() string { +func (x *Application) GetOrganization() string { if x != nil { - return x.ApplicationIdentifier + return x.Organization } return "" } -func (x *Environment) GetKeyType() string { +func (x *Application) GetAttributes() map[string]string { if x != nil { - return x.KeyType + return x.Attributes } - return "" + return nil } var File_wso2_discovery_subscription_application_proto protoreflect.FileDescriptor @@ -272,49 +123,33 @@ var file_wso2_discovery_subscription_application_proto_rawDesc = []byte{ 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xe4, 0x01, 0x0a, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x88, 0x02, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x0a, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, - 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0x4e, 0x0a, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x6f, 0x41, 0x75, 0x74, 0x68, 0x32, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x52, 0x06, 0x6f, 0x41, 0x75, - 0x74, 0x68, 0x32, 0x22, 0x56, 0x0a, 0x06, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0x4c, 0x0a, - 0x0c, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0c, 0x65, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x73, 0x0a, 0x0b, 0x45, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, - 0x76, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x76, 0x49, 0x44, - 0x12, 0x34, 0x0a, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x15, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, - 0x42, 0x93, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, - 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x10, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, - 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, + 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x8d, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, + 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, + 0x6b, 0x2f, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x73, 0x6f, 0x32, + 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -329,23 +164,18 @@ func file_wso2_discovery_subscription_application_proto_rawDescGZIP() []byte { return file_wso2_discovery_subscription_application_proto_rawDescData } -var file_wso2_discovery_subscription_application_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_wso2_discovery_subscription_application_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_wso2_discovery_subscription_application_proto_goTypes = []interface{}{ - (*Application)(nil), // 0: wso2.discovery.subscription.Application - (*SecuritySchemes)(nil), // 1: wso2.discovery.subscription.SecuritySchemes - (*OAuth2)(nil), // 2: wso2.discovery.subscription.OAuth2 - (*Environment)(nil), // 3: wso2.discovery.subscription.Environment - nil, // 4: wso2.discovery.subscription.Application.AttributesEntry + (*Application)(nil), // 0: wso2.discovery.subscription.Application + nil, // 1: wso2.discovery.subscription.Application.AttributesEntry } var file_wso2_discovery_subscription_application_proto_depIdxs = []int32{ - 4, // 0: wso2.discovery.subscription.Application.attributes:type_name -> wso2.discovery.subscription.Application.AttributesEntry - 2, // 1: wso2.discovery.subscription.SecuritySchemes.oAuth2:type_name -> wso2.discovery.subscription.OAuth2 - 3, // 2: wso2.discovery.subscription.OAuth2.environments:type_name -> wso2.discovery.subscription.Environment - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 1, // 0: wso2.discovery.subscription.Application.attributes:type_name -> wso2.discovery.subscription.Application.AttributesEntry + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_wso2_discovery_subscription_application_proto_init() } @@ -366,42 +196,6 @@ func file_wso2_discovery_subscription_application_proto_init() { return nil } } - file_wso2_discovery_subscription_application_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecuritySchemes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wso2_discovery_subscription_application_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OAuth2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wso2_discovery_subscription_application_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Environment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -409,7 +203,7 @@ func file_wso2_discovery_subscription_application_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_wso2_discovery_subscription_application_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go index 146019418..21a914365 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go +++ b/adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go @@ -147,17 +147,17 @@ var file_wso2_discovery_subscription_application_key_mapping_proto_rawDesc = []b 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x76, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x76, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x9d, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x97, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x1a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, - 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, - 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x73, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, 0x2f, 0x61, 0x64, 0x61, + 0x70, 0x74, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping_list.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping_list.pb.go deleted file mode 100644 index 57e890c27..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping_list.pb.go +++ /dev/null @@ -1,183 +0,0 @@ -// -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// Licensed 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/subscription/application_key_mapping_list.proto - -package subscription - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ApplicationKeyMappingList data model -type ApplicationKeyMappingList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []*ApplicationKeyMapping `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *ApplicationKeyMappingList) Reset() { - *x = ApplicationKeyMappingList{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_application_key_mapping_list_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ApplicationKeyMappingList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationKeyMappingList) ProtoMessage() {} - -func (x *ApplicationKeyMappingList) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_application_key_mapping_list_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationKeyMappingList.ProtoReflect.Descriptor instead. -func (*ApplicationKeyMappingList) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationKeyMappingList) GetList() []*ApplicationKeyMapping { - if x != nil { - return x.List - } - return nil -} - -var File_wso2_discovery_subscription_application_key_mapping_list_proto protoreflect.FileDescriptor - -var file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDesc = []byte{ - 0x0a, 0x3e, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x1b, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x39, 0x77, - 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x63, 0x0a, 0x19, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, - 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x42, 0xa1, 0x01, - 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, - 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x1e, - 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDescOnce sync.Once - file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDescData = file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDesc -) - -func file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDescGZIP() []byte { - file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDescOnce.Do(func() { - file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDescData) - }) - return file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDescData -} - -var file_wso2_discovery_subscription_application_key_mapping_list_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_subscription_application_key_mapping_list_proto_goTypes = []interface{}{ - (*ApplicationKeyMappingList)(nil), // 0: wso2.discovery.subscription.ApplicationKeyMappingList - (*ApplicationKeyMapping)(nil), // 1: wso2.discovery.subscription.ApplicationKeyMapping -} -var file_wso2_discovery_subscription_application_key_mapping_list_proto_depIdxs = []int32{ - 1, // 0: wso2.discovery.subscription.ApplicationKeyMappingList.list:type_name -> wso2.discovery.subscription.ApplicationKeyMapping - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_subscription_application_key_mapping_list_proto_init() } -func file_wso2_discovery_subscription_application_key_mapping_list_proto_init() { - if File_wso2_discovery_subscription_application_key_mapping_list_proto != nil { - return - } - file_wso2_discovery_subscription_application_key_mapping_proto_init() - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_subscription_application_key_mapping_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplicationKeyMappingList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_subscription_application_key_mapping_list_proto_goTypes, - DependencyIndexes: file_wso2_discovery_subscription_application_key_mapping_list_proto_depIdxs, - MessageInfos: file_wso2_discovery_subscription_application_key_mapping_list_proto_msgTypes, - }.Build() - File_wso2_discovery_subscription_application_key_mapping_list_proto = out.File - file_wso2_discovery_subscription_application_key_mapping_list_proto_rawDesc = nil - file_wso2_discovery_subscription_application_key_mapping_list_proto_goTypes = nil - file_wso2_discovery_subscription_application_key_mapping_list_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_list.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/application_list.pb.go deleted file mode 100644 index e598420c4..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_list.pb.go +++ /dev/null @@ -1,180 +0,0 @@ -// -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// Licensed 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/subscription/application_list.proto - -package subscription - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ApplicationList data model -type ApplicationList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []*Application `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *ApplicationList) Reset() { - *x = ApplicationList{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_application_list_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ApplicationList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationList) ProtoMessage() {} - -func (x *ApplicationList) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_application_list_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationList.ProtoReflect.Descriptor instead. -func (*ApplicationList) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_application_list_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationList) GetList() []*Application { - if x != nil { - return x.List - } - return nil -} - -var File_wso2_discovery_subscription_application_list_proto protoreflect.FileDescriptor - -var file_wso2_discovery_subscription_application_list_proto_rawDesc = []byte{ - 0x0a, 0x32, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x1a, 0x2d, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x4f, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, - 0x69, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6c, 0x69, 0x73, - 0x74, 0x42, 0x97, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, - 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x14, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_subscription_application_list_proto_rawDescOnce sync.Once - file_wso2_discovery_subscription_application_list_proto_rawDescData = file_wso2_discovery_subscription_application_list_proto_rawDesc -) - -func file_wso2_discovery_subscription_application_list_proto_rawDescGZIP() []byte { - file_wso2_discovery_subscription_application_list_proto_rawDescOnce.Do(func() { - file_wso2_discovery_subscription_application_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_application_list_proto_rawDescData) - }) - return file_wso2_discovery_subscription_application_list_proto_rawDescData -} - -var file_wso2_discovery_subscription_application_list_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_subscription_application_list_proto_goTypes = []interface{}{ - (*ApplicationList)(nil), // 0: wso2.discovery.subscription.ApplicationList - (*Application)(nil), // 1: wso2.discovery.subscription.Application -} -var file_wso2_discovery_subscription_application_list_proto_depIdxs = []int32{ - 1, // 0: wso2.discovery.subscription.ApplicationList.list:type_name -> wso2.discovery.subscription.Application - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_subscription_application_list_proto_init() } -func file_wso2_discovery_subscription_application_list_proto_init() { - if File_wso2_discovery_subscription_application_list_proto != nil { - return - } - file_wso2_discovery_subscription_application_proto_init() - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_subscription_application_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplicationList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_subscription_application_list_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_subscription_application_list_proto_goTypes, - DependencyIndexes: file_wso2_discovery_subscription_application_list_proto_depIdxs, - MessageInfos: file_wso2_discovery_subscription_application_list_proto_msgTypes, - }.Build() - File_wso2_discovery_subscription_application_list_proto = out.File - file_wso2_discovery_subscription_application_list_proto_rawDesc = nil - file_wso2_discovery_subscription_application_list_proto_goTypes = nil - file_wso2_discovery_subscription_application_list_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_policy.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/application_policy.pb.go deleted file mode 100644 index 4160cf722..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_policy.pb.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/subscription/application_policy.proto - -package subscription - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ApplicationPolicy data model -type ApplicationPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - TenantId int32 `protobuf:"varint,2,opt,name=tenantId,proto3" json:"tenantId,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - QuotaType string `protobuf:"bytes,4,opt,name=quotaType,proto3" json:"quotaType,omitempty"` -} - -func (x *ApplicationPolicy) Reset() { - *x = ApplicationPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_application_policy_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ApplicationPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationPolicy) ProtoMessage() {} - -func (x *ApplicationPolicy) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_application_policy_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationPolicy.ProtoReflect.Descriptor instead. -func (*ApplicationPolicy) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_application_policy_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationPolicy) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ApplicationPolicy) GetTenantId() int32 { - if x != nil { - return x.TenantId - } - return 0 -} - -func (x *ApplicationPolicy) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ApplicationPolicy) GetQuotaType() string { - if x != nil { - return x.QuotaType - } - return "" -} - -var File_wso2_discovery_subscription_application_policy_proto protoreflect.FileDescriptor - -var file_wso2_discovery_subscription_application_policy_proto_rawDesc = []byte{ - 0x0a, 0x34, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x71, 0x0a, 0x11, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6e, 0x61, - 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, - 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x6f, 0x74, - 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x71, 0x75, 0x6f, - 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x42, 0x99, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, - 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x16, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, - 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_subscription_application_policy_proto_rawDescOnce sync.Once - file_wso2_discovery_subscription_application_policy_proto_rawDescData = file_wso2_discovery_subscription_application_policy_proto_rawDesc -) - -func file_wso2_discovery_subscription_application_policy_proto_rawDescGZIP() []byte { - file_wso2_discovery_subscription_application_policy_proto_rawDescOnce.Do(func() { - file_wso2_discovery_subscription_application_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_application_policy_proto_rawDescData) - }) - return file_wso2_discovery_subscription_application_policy_proto_rawDescData -} - -var file_wso2_discovery_subscription_application_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_subscription_application_policy_proto_goTypes = []interface{}{ - (*ApplicationPolicy)(nil), // 0: wso2.discovery.subscription.ApplicationPolicy -} -var file_wso2_discovery_subscription_application_policy_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_subscription_application_policy_proto_init() } -func file_wso2_discovery_subscription_application_policy_proto_init() { - if File_wso2_discovery_subscription_application_policy_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_subscription_application_policy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplicationPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_subscription_application_policy_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_subscription_application_policy_proto_goTypes, - DependencyIndexes: file_wso2_discovery_subscription_application_policy_proto_depIdxs, - MessageInfos: file_wso2_discovery_subscription_application_policy_proto_msgTypes, - }.Build() - File_wso2_discovery_subscription_application_policy_proto = out.File - file_wso2_discovery_subscription_application_policy_proto_rawDesc = nil - file_wso2_discovery_subscription_application_policy_proto_goTypes = nil - file_wso2_discovery_subscription_application_policy_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_policy_list.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/application_policy_list.pb.go deleted file mode 100644 index 5a9a5bac8..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_policy_list.pb.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/subscription/application_policy_list.proto - -package subscription - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ApplicationPolicyList data model -type ApplicationPolicyList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []*ApplicationPolicy `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *ApplicationPolicyList) Reset() { - *x = ApplicationPolicyList{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_application_policy_list_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ApplicationPolicyList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationPolicyList) ProtoMessage() {} - -func (x *ApplicationPolicyList) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_application_policy_list_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationPolicyList.ProtoReflect.Descriptor instead. -func (*ApplicationPolicyList) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_application_policy_list_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationPolicyList) GetList() []*ApplicationPolicy { - if x != nil { - return x.List - } - return nil -} - -var File_wso2_discovery_subscription_application_policy_list_proto protoreflect.FileDescriptor - -var file_wso2_discovery_subscription_application_policy_list_proto_rawDesc = []byte{ - 0x0a, 0x39, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, 0x6f, - 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, - 0x0a, 0x15, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x42, 0x9d, 0x01, 0x0a, 0x2c, - 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, - 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x1a, 0x41, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_subscription_application_policy_list_proto_rawDescOnce sync.Once - file_wso2_discovery_subscription_application_policy_list_proto_rawDescData = file_wso2_discovery_subscription_application_policy_list_proto_rawDesc -) - -func file_wso2_discovery_subscription_application_policy_list_proto_rawDescGZIP() []byte { - file_wso2_discovery_subscription_application_policy_list_proto_rawDescOnce.Do(func() { - file_wso2_discovery_subscription_application_policy_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_application_policy_list_proto_rawDescData) - }) - return file_wso2_discovery_subscription_application_policy_list_proto_rawDescData -} - -var file_wso2_discovery_subscription_application_policy_list_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_subscription_application_policy_list_proto_goTypes = []interface{}{ - (*ApplicationPolicyList)(nil), // 0: wso2.discovery.subscription.ApplicationPolicyList - (*ApplicationPolicy)(nil), // 1: wso2.discovery.subscription.ApplicationPolicy -} -var file_wso2_discovery_subscription_application_policy_list_proto_depIdxs = []int32{ - 1, // 0: wso2.discovery.subscription.ApplicationPolicyList.list:type_name -> wso2.discovery.subscription.ApplicationPolicy - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_subscription_application_policy_list_proto_init() } -func file_wso2_discovery_subscription_application_policy_list_proto_init() { - if File_wso2_discovery_subscription_application_policy_list_proto != nil { - return - } - file_wso2_discovery_subscription_application_policy_proto_init() - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_subscription_application_policy_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplicationPolicyList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_subscription_application_policy_list_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_subscription_application_policy_list_proto_goTypes, - DependencyIndexes: file_wso2_discovery_subscription_application_policy_list_proto_depIdxs, - MessageInfos: file_wso2_discovery_subscription_application_policy_list_proto_msgTypes, - }.Build() - File_wso2_discovery_subscription_application_policy_list_proto = out.File - file_wso2_discovery_subscription_application_policy_list_proto_rawDesc = nil - file_wso2_discovery_subscription_application_policy_list_proto_goTypes = nil - file_wso2_discovery_subscription_application_policy_list_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go index 75b502379..3eb0e4da9 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go +++ b/adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go @@ -116,17 +116,16 @@ var file_wso2_discovery_subscription_applicationmapping_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x42, - 0x9a, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, + 0x94, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x17, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, + 0x2f, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping_list.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping_list.pb.go deleted file mode 100644 index 00f95b7a1..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping_list.pb.go +++ /dev/null @@ -1,182 +0,0 @@ -// -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// Licensed 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/subscription/applicationmapping_list.proto - -package subscription - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ApplicationMappingList data model -type ApplicationMappingList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []*ApplicationMapping `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *ApplicationMappingList) Reset() { - *x = ApplicationMappingList{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_applicationmapping_list_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ApplicationMappingList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationMappingList) ProtoMessage() {} - -func (x *ApplicationMappingList) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_applicationmapping_list_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationMappingList.ProtoReflect.Descriptor instead. -func (*ApplicationMappingList) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_applicationmapping_list_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationMappingList) GetList() []*ApplicationMapping { - if x != nil { - return x.List - } - return nil -} - -var File_wso2_discovery_subscription_applicationmapping_list_proto protoreflect.FileDescriptor - -var file_wso2_discovery_subscription_applicationmapping_list_proto_rawDesc = []byte{ - 0x0a, 0x39, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, 0x6f, - 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5d, - 0x0a, 0x16, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x42, 0x9e, 0x01, - 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, - 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x1b, - 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4f, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x3b, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_subscription_applicationmapping_list_proto_rawDescOnce sync.Once - file_wso2_discovery_subscription_applicationmapping_list_proto_rawDescData = file_wso2_discovery_subscription_applicationmapping_list_proto_rawDesc -) - -func file_wso2_discovery_subscription_applicationmapping_list_proto_rawDescGZIP() []byte { - file_wso2_discovery_subscription_applicationmapping_list_proto_rawDescOnce.Do(func() { - file_wso2_discovery_subscription_applicationmapping_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_applicationmapping_list_proto_rawDescData) - }) - return file_wso2_discovery_subscription_applicationmapping_list_proto_rawDescData -} - -var file_wso2_discovery_subscription_applicationmapping_list_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_subscription_applicationmapping_list_proto_goTypes = []interface{}{ - (*ApplicationMappingList)(nil), // 0: wso2.discovery.subscription.ApplicationMappingList - (*ApplicationMapping)(nil), // 1: wso2.discovery.subscription.ApplicationMapping -} -var file_wso2_discovery_subscription_applicationmapping_list_proto_depIdxs = []int32{ - 1, // 0: wso2.discovery.subscription.ApplicationMappingList.list:type_name -> wso2.discovery.subscription.ApplicationMapping - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_subscription_applicationmapping_list_proto_init() } -func file_wso2_discovery_subscription_applicationmapping_list_proto_init() { - if File_wso2_discovery_subscription_applicationmapping_list_proto != nil { - return - } - file_wso2_discovery_subscription_applicationmapping_proto_init() - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_subscription_applicationmapping_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplicationMappingList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_subscription_applicationmapping_list_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_subscription_applicationmapping_list_proto_goTypes, - DependencyIndexes: file_wso2_discovery_subscription_applicationmapping_list_proto_depIdxs, - MessageInfos: file_wso2_discovery_subscription_applicationmapping_list_proto_msgTypes, - }.Build() - File_wso2_discovery_subscription_applicationmapping_list_proto = out.File - file_wso2_discovery_subscription_applicationmapping_list_proto_rawDesc = nil - file_wso2_discovery_subscription_applicationmapping_list_proto_goTypes = nil - file_wso2_discovery_subscription_applicationmapping_list_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/event.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/event.pb.go new file mode 100644 index 000000000..bb97a44e6 --- /dev/null +++ b/adapter/pkg/discovery/api/wso2/discovery/subscription/event.pb.go @@ -0,0 +1,267 @@ +// +// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// +// Licensed 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. +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.13.0 +// source: wso2/discovery/subscription/event.proto + +package subscription + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Event data model +type Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + TimeStamp int64 `protobuf:"varint,2,opt,name=timeStamp,proto3" json:"timeStamp,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Application *Application `protobuf:"bytes,4,opt,name=application,proto3" json:"application,omitempty"` + ApplicationMapping *ApplicationMapping `protobuf:"bytes,5,opt,name=applicationMapping,proto3" json:"applicationMapping,omitempty"` + ApplicationKeyMapping *ApplicationKeyMapping `protobuf:"bytes,6,opt,name=applicationKeyMapping,proto3" json:"applicationKeyMapping,omitempty"` + Subscription *Subscription `protobuf:"bytes,7,opt,name=subscription,proto3" json:"subscription,omitempty"` +} + +func (x *Event) Reset() { + *x = Event{} + if protoimpl.UnsafeEnabled { + mi := &file_wso2_discovery_subscription_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Event) ProtoMessage() {} + +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_wso2_discovery_subscription_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_wso2_discovery_subscription_event_proto_rawDescGZIP(), []int{0} +} + +func (x *Event) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *Event) GetTimeStamp() int64 { + if x != nil { + return x.TimeStamp + } + return 0 +} + +func (x *Event) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Event) GetApplication() *Application { + if x != nil { + return x.Application + } + return nil +} + +func (x *Event) GetApplicationMapping() *ApplicationMapping { + if x != nil { + return x.ApplicationMapping + } + return nil +} + +func (x *Event) GetApplicationKeyMapping() *ApplicationKeyMapping { + if x != nil { + return x.ApplicationKeyMapping + } + return nil +} + +func (x *Event) GetSubscription() *Subscription { + if x != nil { + return x.Subscription + } + return nil +} + +var File_wso2_discovery_subscription_event_proto protoreflect.FileDescriptor + +var file_wso2_discovery_subscription_event_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, 0x6f, 0x32, 0x2e, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2d, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x34, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x39, 0x77, 0x73, 0x6f, + 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x03, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x75, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x73, + 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x5f, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, + 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, + 0x12, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x12, 0x68, 0x0a, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x4d, 0x0a, + 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x87, 0x01, 0x0a, + 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, + 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, + 0x2f, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_wso2_discovery_subscription_event_proto_rawDescOnce sync.Once + file_wso2_discovery_subscription_event_proto_rawDescData = file_wso2_discovery_subscription_event_proto_rawDesc +) + +func file_wso2_discovery_subscription_event_proto_rawDescGZIP() []byte { + file_wso2_discovery_subscription_event_proto_rawDescOnce.Do(func() { + file_wso2_discovery_subscription_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_event_proto_rawDescData) + }) + return file_wso2_discovery_subscription_event_proto_rawDescData +} + +var file_wso2_discovery_subscription_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_wso2_discovery_subscription_event_proto_goTypes = []interface{}{ + (*Event)(nil), // 0: wso2.discovery.subscription.Event + (*Application)(nil), // 1: wso2.discovery.subscription.Application + (*ApplicationMapping)(nil), // 2: wso2.discovery.subscription.ApplicationMapping + (*ApplicationKeyMapping)(nil), // 3: wso2.discovery.subscription.ApplicationKeyMapping + (*Subscription)(nil), // 4: wso2.discovery.subscription.Subscription +} +var file_wso2_discovery_subscription_event_proto_depIdxs = []int32{ + 1, // 0: wso2.discovery.subscription.Event.application:type_name -> wso2.discovery.subscription.Application + 2, // 1: wso2.discovery.subscription.Event.applicationMapping:type_name -> wso2.discovery.subscription.ApplicationMapping + 3, // 2: wso2.discovery.subscription.Event.applicationKeyMapping:type_name -> wso2.discovery.subscription.ApplicationKeyMapping + 4, // 3: wso2.discovery.subscription.Event.subscription:type_name -> wso2.discovery.subscription.Subscription + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_wso2_discovery_subscription_event_proto_init() } +func file_wso2_discovery_subscription_event_proto_init() { + if File_wso2_discovery_subscription_event_proto != nil { + return + } + file_wso2_discovery_subscription_application_proto_init() + file_wso2_discovery_subscription_applicationmapping_proto_init() + file_wso2_discovery_subscription_application_key_mapping_proto_init() + file_wso2_discovery_subscription_subscription_proto_init() + if !protoimpl.UnsafeEnabled { + file_wso2_discovery_subscription_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_wso2_discovery_subscription_event_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_wso2_discovery_subscription_event_proto_goTypes, + DependencyIndexes: file_wso2_discovery_subscription_event_proto_depIdxs, + MessageInfos: file_wso2_discovery_subscription_event_proto_msgTypes, + }.Build() + File_wso2_discovery_subscription_event_proto = out.File + file_wso2_discovery_subscription_event_proto_rawDesc = nil + file_wso2_discovery_subscription_event_proto_goTypes = nil + file_wso2_discovery_subscription_event_proto_depIdxs = nil +} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go index e4c9d7bc0..a28d25531 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go +++ b/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go @@ -186,17 +186,16 @@ var file_wso2_discovery_subscription_subscription_proto_rawDesc = []byte{ 0x69, 0x62, 0x65, 0x64, 0x41, 0x50, 0x49, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x94, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x8e, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, + 0x2f, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_list.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_list.pb.go deleted file mode 100644 index 5a493f3f5..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_list.pb.go +++ /dev/null @@ -1,180 +0,0 @@ -// -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// Licensed 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. -// - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/subscription/subscription_list.proto - -package subscription - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// SubscriptionList data model -type SubscriptionList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []*Subscription `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *SubscriptionList) Reset() { - *x = SubscriptionList{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_subscription_list_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubscriptionList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscriptionList) ProtoMessage() {} - -func (x *SubscriptionList) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_subscription_list_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscriptionList.ProtoReflect.Descriptor instead. -func (*SubscriptionList) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_subscription_list_proto_rawDescGZIP(), []int{0} -} - -func (x *SubscriptionList) GetList() []*Subscription { - if x != nil { - return x.List - } - return nil -} - -var File_wso2_discovery_subscription_subscription_list_proto protoreflect.FileDescriptor - -var file_wso2_discovery_subscription_subscription_list_proto_rawDesc = []byte{ - 0x0a, 0x33, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x51, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x04, 0x6c, 0x69, 0x73, 0x74, 0x42, 0x98, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, - 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x15, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x3b, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_subscription_subscription_list_proto_rawDescOnce sync.Once - file_wso2_discovery_subscription_subscription_list_proto_rawDescData = file_wso2_discovery_subscription_subscription_list_proto_rawDesc -) - -func file_wso2_discovery_subscription_subscription_list_proto_rawDescGZIP() []byte { - file_wso2_discovery_subscription_subscription_list_proto_rawDescOnce.Do(func() { - file_wso2_discovery_subscription_subscription_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_subscription_list_proto_rawDescData) - }) - return file_wso2_discovery_subscription_subscription_list_proto_rawDescData -} - -var file_wso2_discovery_subscription_subscription_list_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_subscription_subscription_list_proto_goTypes = []interface{}{ - (*SubscriptionList)(nil), // 0: wso2.discovery.subscription.SubscriptionList - (*Subscription)(nil), // 1: wso2.discovery.subscription.Subscription -} -var file_wso2_discovery_subscription_subscription_list_proto_depIdxs = []int32{ - 1, // 0: wso2.discovery.subscription.SubscriptionList.list:type_name -> wso2.discovery.subscription.Subscription - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_subscription_subscription_list_proto_init() } -func file_wso2_discovery_subscription_subscription_list_proto_init() { - if File_wso2_discovery_subscription_subscription_list_proto != nil { - return - } - file_wso2_discovery_subscription_subscription_proto_init() - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_subscription_subscription_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscriptionList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_subscription_subscription_list_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_subscription_subscription_list_proto_goTypes, - DependencyIndexes: file_wso2_discovery_subscription_subscription_list_proto_depIdxs, - MessageInfos: file_wso2_discovery_subscription_subscription_list_proto_msgTypes, - }.Build() - File_wso2_discovery_subscription_subscription_list_proto = out.File - file_wso2_discovery_subscription_subscription_list_proto_rawDesc = nil - file_wso2_discovery_subscription_subscription_list_proto_goTypes = nil - file_wso2_discovery_subscription_subscription_list_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_policy.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_policy.pb.go deleted file mode 100644 index 073c867c3..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_policy.pb.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/subscription/subscription_policy.proto - -package subscription - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// SubscriptionPolicy data model -type SubscriptionPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - TenantId int32 `protobuf:"varint,2,opt,name=tenantId,proto3" json:"tenantId,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - QuotaType string `protobuf:"bytes,4,opt,name=quotaType,proto3" json:"quotaType,omitempty"` - GraphQLMaxComplexity int32 `protobuf:"varint,5,opt,name=graphQLMaxComplexity,proto3" json:"graphQLMaxComplexity,omitempty"` - GraphQLMaxDepth int32 `protobuf:"varint,6,opt,name=graphQLMaxDepth,proto3" json:"graphQLMaxDepth,omitempty"` - RateLimitCount int32 `protobuf:"varint,7,opt,name=rateLimitCount,proto3" json:"rateLimitCount,omitempty"` - RateLimitTimeUnit string `protobuf:"bytes,8,opt,name=rateLimitTimeUnit,proto3" json:"rateLimitTimeUnit,omitempty"` - StopOnQuotaReach bool `protobuf:"varint,9,opt,name=stopOnQuotaReach,proto3" json:"stopOnQuotaReach,omitempty"` - TenantDomain string `protobuf:"bytes,10,opt,name=tenantDomain,proto3" json:"tenantDomain,omitempty"` - Timestamp int64 `protobuf:"varint,11,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *SubscriptionPolicy) Reset() { - *x = SubscriptionPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_subscription_policy_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubscriptionPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscriptionPolicy) ProtoMessage() {} - -func (x *SubscriptionPolicy) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_subscription_policy_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscriptionPolicy.ProtoReflect.Descriptor instead. -func (*SubscriptionPolicy) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_subscription_policy_proto_rawDescGZIP(), []int{0} -} - -func (x *SubscriptionPolicy) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *SubscriptionPolicy) GetTenantId() int32 { - if x != nil { - return x.TenantId - } - return 0 -} - -func (x *SubscriptionPolicy) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *SubscriptionPolicy) GetQuotaType() string { - if x != nil { - return x.QuotaType - } - return "" -} - -func (x *SubscriptionPolicy) GetGraphQLMaxComplexity() int32 { - if x != nil { - return x.GraphQLMaxComplexity - } - return 0 -} - -func (x *SubscriptionPolicy) GetGraphQLMaxDepth() int32 { - if x != nil { - return x.GraphQLMaxDepth - } - return 0 -} - -func (x *SubscriptionPolicy) GetRateLimitCount() int32 { - if x != nil { - return x.RateLimitCount - } - return 0 -} - -func (x *SubscriptionPolicy) GetRateLimitTimeUnit() string { - if x != nil { - return x.RateLimitTimeUnit - } - return "" -} - -func (x *SubscriptionPolicy) GetStopOnQuotaReach() bool { - if x != nil { - return x.StopOnQuotaReach - } - return false -} - -func (x *SubscriptionPolicy) GetTenantDomain() string { - if x != nil { - return x.TenantDomain - } - return "" -} - -func (x *SubscriptionPolicy) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -var File_wso2_discovery_subscription_subscription_policy_proto protoreflect.FileDescriptor - -var file_wso2_discovery_subscription_subscription_policy_proto_rawDesc = []byte{ - 0x0a, 0x35, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x03, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, - 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, - 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x71, - 0x75, 0x6f, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x71, 0x75, 0x6f, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x14, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x51, 0x4c, 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, - 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x67, 0x72, 0x61, 0x70, 0x68, 0x51, 0x4c, - 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x74, 0x79, 0x12, 0x28, 0x0a, - 0x0f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x51, 0x4c, 0x4d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x51, 0x4c, 0x4d, - 0x61, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x61, 0x74, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0e, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x2c, 0x0a, 0x11, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, - 0x55, 0x6e, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x72, 0x61, 0x74, 0x65, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x2a, 0x0a, - 0x10, 0x73, 0x74, 0x6f, 0x70, 0x4f, 0x6e, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x52, 0x65, 0x61, 0x63, - 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x74, 0x6f, 0x70, 0x4f, 0x6e, 0x51, - 0x75, 0x6f, 0x74, 0x61, 0x52, 0x65, 0x61, 0x63, 0x68, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x65, 0x6e, - 0x61, 0x6e, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x9a, 0x01, 0x0a, 0x2c, - 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x65, 0x6e, 0x66, - 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x17, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, - 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, - 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x73, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_subscription_subscription_policy_proto_rawDescOnce sync.Once - file_wso2_discovery_subscription_subscription_policy_proto_rawDescData = file_wso2_discovery_subscription_subscription_policy_proto_rawDesc -) - -func file_wso2_discovery_subscription_subscription_policy_proto_rawDescGZIP() []byte { - file_wso2_discovery_subscription_subscription_policy_proto_rawDescOnce.Do(func() { - file_wso2_discovery_subscription_subscription_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_subscription_policy_proto_rawDescData) - }) - return file_wso2_discovery_subscription_subscription_policy_proto_rawDescData -} - -var file_wso2_discovery_subscription_subscription_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_subscription_subscription_policy_proto_goTypes = []interface{}{ - (*SubscriptionPolicy)(nil), // 0: wso2.discovery.subscription.SubscriptionPolicy -} -var file_wso2_discovery_subscription_subscription_policy_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_subscription_subscription_policy_proto_init() } -func file_wso2_discovery_subscription_subscription_policy_proto_init() { - if File_wso2_discovery_subscription_subscription_policy_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_subscription_subscription_policy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscriptionPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_subscription_subscription_policy_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_subscription_subscription_policy_proto_goTypes, - DependencyIndexes: file_wso2_discovery_subscription_subscription_policy_proto_depIdxs, - MessageInfos: file_wso2_discovery_subscription_subscription_policy_proto_msgTypes, - }.Build() - File_wso2_discovery_subscription_subscription_policy_proto = out.File - file_wso2_discovery_subscription_subscription_policy_proto_rawDesc = nil - file_wso2_discovery_subscription_subscription_policy_proto_goTypes = nil - file_wso2_discovery_subscription_subscription_policy_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_policy_list.pb.go b/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_policy_list.pb.go deleted file mode 100644 index ccb2f46e1..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription_policy_list.pb.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/subscription/subscription_policy_list.proto - -package subscription - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// SubscriptionPolicyList data model -type SubscriptionPolicyList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []*SubscriptionPolicy `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *SubscriptionPolicyList) Reset() { - *x = SubscriptionPolicyList{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_subscription_subscription_policy_list_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubscriptionPolicyList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscriptionPolicyList) ProtoMessage() {} - -func (x *SubscriptionPolicyList) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_subscription_subscription_policy_list_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscriptionPolicyList.ProtoReflect.Descriptor instead. -func (*SubscriptionPolicyList) Descriptor() ([]byte, []int) { - return file_wso2_discovery_subscription_subscription_policy_list_proto_rawDescGZIP(), []int{0} -} - -func (x *SubscriptionPolicyList) GetList() []*SubscriptionPolicy { - if x != nil { - return x.List - } - return nil -} - -var File_wso2_discovery_subscription_subscription_policy_list_proto protoreflect.FileDescriptor - -var file_wso2_discovery_subscription_subscription_policy_list_proto_rawDesc = []byte{ - 0x0a, 0x3a, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x73, - 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x35, 0x77, 0x73, 0x6f, 0x32, 0x2f, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x5d, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x6c, 0x69, - 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x42, - 0x9e, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x61, 0x70, 0x6b, - 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x1b, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x3b, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_subscription_subscription_policy_list_proto_rawDescOnce sync.Once - file_wso2_discovery_subscription_subscription_policy_list_proto_rawDescData = file_wso2_discovery_subscription_subscription_policy_list_proto_rawDesc -) - -func file_wso2_discovery_subscription_subscription_policy_list_proto_rawDescGZIP() []byte { - file_wso2_discovery_subscription_subscription_policy_list_proto_rawDescOnce.Do(func() { - file_wso2_discovery_subscription_subscription_policy_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_subscription_policy_list_proto_rawDescData) - }) - return file_wso2_discovery_subscription_subscription_policy_list_proto_rawDescData -} - -var file_wso2_discovery_subscription_subscription_policy_list_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_subscription_subscription_policy_list_proto_goTypes = []interface{}{ - (*SubscriptionPolicyList)(nil), // 0: wso2.discovery.subscription.SubscriptionPolicyList - (*SubscriptionPolicy)(nil), // 1: wso2.discovery.subscription.SubscriptionPolicy -} -var file_wso2_discovery_subscription_subscription_policy_list_proto_depIdxs = []int32{ - 1, // 0: wso2.discovery.subscription.SubscriptionPolicyList.list:type_name -> wso2.discovery.subscription.SubscriptionPolicy - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_wso2_discovery_subscription_subscription_policy_list_proto_init() } -func file_wso2_discovery_subscription_subscription_policy_list_proto_init() { - if File_wso2_discovery_subscription_subscription_policy_list_proto != nil { - return - } - file_wso2_discovery_subscription_subscription_policy_proto_init() - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_subscription_subscription_policy_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscriptionPolicyList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_wso2_discovery_subscription_subscription_policy_list_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_subscription_subscription_policy_list_proto_goTypes, - DependencyIndexes: file_wso2_discovery_subscription_subscription_policy_list_proto_depIdxs, - MessageInfos: file_wso2_discovery_subscription_subscription_policy_list_proto_msgTypes, - }.Build() - File_wso2_discovery_subscription_subscription_policy_list_proto = out.File - file_wso2_discovery_subscription_subscription_policy_list_proto_rawDesc = nil - file_wso2_discovery_subscription_subscription_policy_list_proto_goTypes = nil - file_wso2_discovery_subscription_subscription_policy_list_proto_depIdxs = nil -} diff --git a/adapter/pkg/discovery/protocol/cache/v3/resource.go b/adapter/pkg/discovery/protocol/cache/v3/resource.go index 710f1e3d6..526b4bff5 100644 --- a/adapter/pkg/discovery/protocol/cache/v3/resource.go +++ b/adapter/pkg/discovery/protocol/cache/v3/resource.go @@ -19,9 +19,7 @@ import ( envoy_types "github.com/envoyproxy/go-control-plane/pkg/cache/types" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/api" - apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/apkmgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/config/enforcer" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/keymgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" "github.com/wso2/apk/adapter/pkg/discovery/protocol/cache/types" "github.com/wso2/apk/adapter/pkg/discovery/protocol/resource/v3" @@ -78,28 +76,10 @@ func GetResourceName(res envoy_types.Resource) string { return fmt.Sprint(v.Vhost, v.BasePath, v.Version) case *enforcer.Config: return "Config" - case *subscription.SubscriptionList: - return "Subscription" - case *subscription.ApplicationList: - return "Application" case *subscription.JWTIssuerList: return "JWTIssuer" - case *subscription.ApplicationKeyMappingList: - return "ApplicationKeyMapping" - case *subscription.ApplicationMappingList: - return "ApplicationMapping" case *subscription.APIList: return "APIList" - case *subscription.ApplicationPolicyList: - return "ApplicationPolicyList" - case *subscription.SubscriptionPolicyList: - return "SubscriptionPolicyList" - case *keymgt.KeyManagerConfig: - return fmt.Sprint(v.Name) - case *apkmgt.Application: - return fmt.Sprint(v.Uuid) - case *keymgt.RevokedToken: - return fmt.Sprint(v.Jti) case *subscription.Application: return fmt.Sprint(v.Uuid) case *subscription.Subscription: diff --git a/common-controller/commoncontroller/common_controller.go b/common-controller/commoncontroller/common_controller.go index 52e219e62..384fba54d 100644 --- a/common-controller/commoncontroller/common_controller.go +++ b/common-controller/commoncontroller/common_controller.go @@ -31,23 +31,19 @@ import ( discoveryv3 "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" envoy_cachev3 "github.com/envoyproxy/go-control-plane/pkg/cache/v3" xdsv3 "github.com/envoyproxy/go-control-plane/pkg/server/v3" - enforcerCallbacks "github.com/wso2/apk/common-controller/internal/xds/enforcercallbacks" - routercb "github.com/wso2/apk/common-controller/internal/xds/routercallbacks" - apiservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/api" - configservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/config" - subscriptionservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/subscription" - wso2_server "github.com/wso2/apk/adapter/pkg/discovery/protocol/server/v3" + apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" "github.com/wso2/apk/adapter/pkg/health" healthservice "github.com/wso2/apk/adapter/pkg/health/api/wso2/health/service" + "github.com/wso2/apk/adapter/pkg/logging" "github.com/wso2/apk/common-controller/internal/config" + "github.com/wso2/apk/common-controller/internal/loggers" "github.com/wso2/apk/common-controller/internal/operator" + "github.com/wso2/apk/common-controller/internal/server" utils "github.com/wso2/apk/common-controller/internal/utils" xds "github.com/wso2/apk/common-controller/internal/xds" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/keepalive" - "github.com/wso2/apk/adapter/pkg/logging" - "github.com/wso2/apk/common-controller/internal/loggers" ) var ( @@ -147,9 +143,7 @@ func runRatelimitServer(rlsServer xdsv3.Server) { }() } -func runCommonEnforcerServer(server xdsv3.Server, enforcerServer wso2_server.Server, enforcerSdsServer wso2_server.Server, - enforcerAppDsSrv wso2_server.Server, enforcerAppKeyMappingDsSrv wso2_server.Server, enforcerAppMappingDsSrv wso2_server.Server, - port uint) { +func runCommonEnforcerServer(Port uint) { var grpcOptions []grpc.ServerOption grpcOptions = append(grpcOptions, grpc.MaxConcurrentStreams(grpcMaxConcurrentStreams)) // TODO(Ashera): Add TLS support for Common Controller - Enforcer connection @@ -183,16 +177,7 @@ func runCommonEnforcerServer(server xdsv3.Server, enforcerServer wso2_server.Ser if err != nil { loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error1100, logging.BLOCKER, "Failed to listen on port: %v, error: %v", port, err.Error())) } - - // register services - discoveryv3.RegisterAggregatedDiscoveryServiceServer(grpcServer, server) - configservice.RegisterConfigDiscoveryServiceServer(grpcServer, enforcerServer) - apiservice.RegisterApiDiscoveryServiceServer(grpcServer, enforcerServer) - subscriptionservice.RegisterSubscriptionDiscoveryServiceServer(grpcServer, enforcerSdsServer) - subscriptionservice.RegisterApplicationDiscoveryServiceServer(grpcServer, enforcerAppDsSrv) - subscriptionservice.RegisterApplicationKeyMappingDiscoveryServiceServer(grpcServer, enforcerAppKeyMappingDsSrv) - subscriptionservice.RegisterApplicationMappingDiscoveryServiceServer(grpcServer, enforcerAppMappingDsSrv) - // register health service + apkmgt.RegisterEventStreamServiceServer(grpcServer, &server.EventServer{}) healthservice.RegisterHealthServer(grpcServer, &health.Server{}) loggers.LoggerAPKOperator.Info("port: ", port, " common enforcer server listening") @@ -224,22 +209,8 @@ func InitCommonControllerServer(conf *config.Config) { // Set empty snapshot to initiate ratelimit service xds.SetEmptySnapshotupdate(conf.CommonController.Server.Label) - cache := xds.GetXdsCache() - enforcerCache := xds.GetEnforcerCache() - enforcerSubscriptionCache := xds.GetEnforcerSubscriptionCache() - enforcerApplicationCache := xds.GetEnforcerApplicationCache() - enforcerApplicationKeyMappingCache := xds.GetEnforcerApplicationKeyMappingCache() - enforcerApplicationMappingCache := xds.GetEnforcerApplicationMappingCache() - srv := xdsv3.NewServer(ctx, cache, &routercb.Callbacks{}) - enforcerXdsSrv := wso2_server.NewServer(ctx, enforcerCache, &enforcerCallbacks.Callbacks{}) - enforcerSdsSrv := wso2_server.NewServer(ctx, enforcerSubscriptionCache, &enforcerCallbacks.Callbacks{}) - enforcerAppDsSrv := wso2_server.NewServer(ctx, enforcerApplicationCache, &enforcerCallbacks.Callbacks{}) - enforcerAppKeyMappingDsSrv := wso2_server.NewServer(ctx, enforcerApplicationKeyMappingCache, &enforcerCallbacks.Callbacks{}) - enforcerAppMappingDsSrv := wso2_server.NewServer(ctx, enforcerApplicationMappingCache, &enforcerCallbacks.Callbacks{}) - // Start Enforcer xDS gRPC server - runCommonEnforcerServer(srv, enforcerXdsSrv, enforcerSdsSrv, enforcerAppDsSrv, enforcerAppKeyMappingDsSrv, - enforcerAppMappingDsSrv, port) + runCommonEnforcerServer(port) go operator.InitOperator() diff --git a/common-controller/internal/cache/subscriptionDataStore.go b/common-controller/internal/cache/subscriptionDataStore.go new file mode 100644 index 000000000..7e4ab9abd --- /dev/null +++ b/common-controller/internal/cache/subscriptionDataStore.go @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2023 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * Licensed 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. + * + */ + +package cache + +import ( + "sync" + + logger "github.com/sirupsen/logrus" + cpv1alpha2 "github.com/wso2/apk/common-controller/internal/operator/apis/cp/v1alpha2" + "k8s.io/apimachinery/pkg/types" +) + +// SubscriptionDataStore is a cache subscription data. +type SubscriptionDataStore struct { + applicationStore map[types.NamespacedName]*cpv1alpha2.ApplicationSpec + subscriptionStore map[types.NamespacedName]*cpv1alpha2.SubscriptionSpec + applicationMappingStore map[types.NamespacedName]*cpv1alpha2.ApplicationMappingSpec + mu sync.Mutex +} + +// CreateNewSubscriptionDataStore creates a new SubscriptionDataStore. +func CreateNewSubscriptionDataStore() *SubscriptionDataStore { + return &SubscriptionDataStore{ + applicationStore: map[types.NamespacedName]*cpv1alpha2.ApplicationSpec{}, + subscriptionStore: map[types.NamespacedName]*cpv1alpha2.SubscriptionSpec{}, + applicationMappingStore: map[types.NamespacedName]*cpv1alpha2.ApplicationMappingSpec{}, + } +} + +// AddorUpdateApplicationToStore adds a new application to the DataStore. +func (ods *SubscriptionDataStore) AddorUpdateApplicationToStore(name types.NamespacedName, application cpv1alpha2.ApplicationSpec) { + ods.mu.Lock() + defer ods.mu.Unlock() + logger.Debug("Adding/Updating application to cache") + ods.applicationStore[name] = &application +} + +// AddorUpdateSubscriptionToStore adds a new subscription to the DataStore. +func (ods *SubscriptionDataStore) AddorUpdateSubscriptionToStore(name types.NamespacedName, subscription cpv1alpha2.SubscriptionSpec) { + ods.mu.Lock() + defer ods.mu.Unlock() + logger.Debug("Adding/Updating subscription to cache") + ods.subscriptionStore[name] = &subscription +} + +// AddorUpdateApplicationMappingToStore adds a new application mapping to the DataStore. +func (ods *SubscriptionDataStore) AddorUpdateApplicationMappingToStore(name types.NamespacedName, applicationMapping cpv1alpha2.ApplicationMappingSpec) { + ods.mu.Lock() + defer ods.mu.Unlock() + logger.Debug("Adding/Updating application mapping to cache") + ods.applicationMappingStore[name] = &applicationMapping +} + +// GetApplicationFromStore get cached application +func (ods *SubscriptionDataStore) GetApplicationFromStore(name types.NamespacedName) (cpv1alpha2.ApplicationSpec, bool) { + var application cpv1alpha2.ApplicationSpec + if cachedApplication, found := ods.applicationStore[name]; found { + logger.Debug("Found cached application") + return *cachedApplication, true + } + return application, false +} + +// GetSubscriptionFromStore get cached subscription +func (ods *SubscriptionDataStore) GetSubscriptionFromStore(name types.NamespacedName) (cpv1alpha2.SubscriptionSpec, bool) { + var subscription cpv1alpha2.SubscriptionSpec + if cachedSubscription, found := ods.subscriptionStore[name]; found { + logger.Debug("Found cached subscription") + return *cachedSubscription, true + } + return subscription, false +} + +// GetApplicationMappingFromStore get cached application mapping +func (ods *SubscriptionDataStore) GetApplicationMappingFromStore(name types.NamespacedName) (cpv1alpha2.ApplicationMappingSpec, bool) { + var applicationMapping cpv1alpha2.ApplicationMappingSpec + if cachedApplicationMapping, found := ods.applicationMappingStore[name]; found { + logger.Debug("Found cached application mapping") + return *cachedApplicationMapping, true + } + return applicationMapping, false +} + +// DeleteApplicationFromStore delete from application cache +func (ods *SubscriptionDataStore) DeleteApplicationFromStore(name types.NamespacedName) { + ods.mu.Lock() + defer ods.mu.Unlock() + logger.Debug("Deleting application from cache") + delete(ods.applicationStore, name) +} + +// DeleteSubscriptionFromStore delete from subscription cache +func (ods *SubscriptionDataStore) DeleteSubscriptionFromStore(name types.NamespacedName) { + ods.mu.Lock() + defer ods.mu.Unlock() + logger.Debug("Deleting subscription from cache") + delete(ods.subscriptionStore, name) +} + +// DeleteApplicationMappingFromStore delete from application mapping cache +func (ods *SubscriptionDataStore) DeleteApplicationMappingFromStore(name types.NamespacedName) { + ods.mu.Lock() + defer ods.mu.Unlock() + logger.Debug("Deleting application mapping from cache") + delete(ods.applicationMappingStore, name) +} diff --git a/common-controller/internal/operator/constant/constant.go b/common-controller/internal/operator/constant/constant.go index cb2e18985..a9bb47769 100644 --- a/common-controller/internal/operator/constant/constant.go +++ b/common-controller/internal/operator/constant/constant.go @@ -32,6 +32,21 @@ const ( Delete string = "DELETED" ) +const ( + APPLICATION_CREATED string = "APPLICATION_CREATED" + APPLICATION_UPDATED string = "APPLICATION_UPDATED" + APPLICATION_DELETED string = "APPLICATION_DELETED" + SUBSCRIPTION_CREATED string = "SUBSCRIPTION_CREATED" + SUBSCRIPTION_UPDATED string = "SUBSCRIPTION_UPDATED" + SUBSCRIPTION_DELETED string = "SUBSCRIPTION_DELETED" + APPLICATION_MAPPING_CREATED string = "APPLICATION_MAPPING_CREATED" + APPLICATION_MAPPING_UPDATED string = "APPLICATION_MAPPING_UPDATED" + APPLICATION_MAPPING_DELETED string = "APPLICATION_MAPPING_DELETED" + APPLICATION_KEY_MAPPING_CREATED string = "APPLICATION_KEY_MAPPING_CREATED" + APPLICATION_KEY_MAPPING_UPDATED string = "APPLICATION_KEY_MAPPING_UPDATED" + APPLICATION_KEY_MAPPING_DELETED string = "APPLICATION_KEY_MAPPING_DELETED" +) + // Environment variable names and default values const ( OperatorPodNamespace string = "OPERATOR_POD_NAMESPACE" diff --git a/common-controller/internal/operator/controllers/cp/application_controller.go b/common-controller/internal/operator/controllers/cp/application_controller.go index b5c49d730..9c681ee92 100644 --- a/common-controller/internal/operator/controllers/cp/application_controller.go +++ b/common-controller/internal/operator/controllers/cp/application_controller.go @@ -22,11 +22,13 @@ import ( "fmt" "github.com/wso2/apk/adapter/pkg/logging" + "github.com/wso2/apk/common-controller/internal/cache" "github.com/wso2/apk/common-controller/internal/loggers" cpv1alpha2 "github.com/wso2/apk/common-controller/internal/operator/apis/cp/v1alpha2" constants "github.com/wso2/apk/common-controller/internal/operator/constant" "github.com/wso2/apk/common-controller/internal/server" "github.com/wso2/apk/common-controller/internal/utils" + k8error "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -43,12 +45,14 @@ import ( type ApplicationReconciler struct { client client.Client Scheme *runtime.Scheme + ods *cache.SubscriptionDataStore } // NewApplicationController creates a new Application controller instance -func NewApplicationController(mgr manager.Manager) error { +func NewApplicationController(mgr manager.Manager, subscriptionStore *cache.SubscriptionDataStore) error { r := &ApplicationReconciler{ client: mgr.GetClient(), + ods: subscriptionStore, } c, err := controller.New(constants.ApplicationController, mgr, controller.Options{Reconciler: r}) if err != nil { @@ -89,7 +93,29 @@ func (applicationReconciler *ApplicationReconciler) Reconcile(ctx context.Contex return reconcile.Result{}, fmt.Errorf("failed to get applications %s/%s", applicationKey.Namespace, applicationKey.Name) } + var application cpv1alpha2.Application + if err := applicationReconciler.client.Get(ctx, req.NamespacedName, &application); err != nil { + if k8error.IsNotFound(err) { + applicationSpec, found := applicationReconciler.ods.GetApplicationFromStore(applicationKey) + if found { + utils.SendAppDeletionEvent(applicationKey.Name, applicationSpec) + applicationReconciler.ods.DeleteApplicationFromStore(applicationKey) + return ctrl.Result{}, nil + } else { + loggers.LoggerAPKOperator.Debugf("Application %s/%s does not exist in k8s", applicationKey.Namespace, applicationKey.Name) + } + } else { + applicationSpec, found := applicationReconciler.ods.GetApplicationFromStore(applicationKey) + if found { + // update + utils.SendAppUpdateEvent(applicationKey.Name, applicationSpec, application.Spec) + } else { + utils.SendAddApplicationEvent(application) + } + applicationReconciler.ods.AddorUpdateApplicationToStore(applicationKey, application.Spec) + } + } sendAppUpdates(applicationList) return ctrl.Result{}, nil } diff --git a/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go b/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go index b450013c0..837aa57fc 100644 --- a/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go +++ b/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go @@ -22,8 +22,10 @@ import ( "fmt" "github.com/wso2/apk/adapter/pkg/logging" + "github.com/wso2/apk/common-controller/internal/cache" "github.com/wso2/apk/common-controller/internal/loggers" "github.com/wso2/apk/common-controller/internal/server" + k8error "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -44,12 +46,14 @@ import ( type ApplicationMappingReconciler struct { client client.Client Scheme *runtime.Scheme + ods *cache.SubscriptionDataStore } // NewApplicationMappingController creates a new Application and Subscription mapping (i.e. ApplicationMapping) controller instance -func NewApplicationMappingController(mgr manager.Manager) error { +func NewApplicationMappingController(mgr manager.Manager, subscriptionStore *cache.SubscriptionDataStore) error { r := &ApplicationMappingReconciler{ client: mgr.GetClient(), + ods: subscriptionStore, } c, err := controller.New(constants.ApplicationMappingController, mgr, controller.Options{Reconciler: r}) if err != nil { @@ -90,7 +94,21 @@ func (r *ApplicationMappingReconciler) Reconcile(ctx context.Context, req ctrl.R return reconcile.Result{}, fmt.Errorf("failed to get application mappings %s/%s", applicationMappingKey.Namespace, applicationMappingKey.Name) } - + var applicationMapping cpv1alpha2.ApplicationMapping + if err := r.client.Get(ctx, req.NamespacedName, &applicationMapping); err != nil { + if k8error.IsNotFound(err) { + applicationMapping, found := r.ods.GetApplicationMappingFromStore(applicationMappingKey) + if !found { + loggers.LoggerAPKOperator.Debugf("Application mapping %s/%s not found. Ignoring since object must be deleted", applicationMappingKey.Namespace, applicationMappingKey.Name) + } else { + utils.SendDeleteApplicationMappingEvent(applicationMappingKey.Name, applicationMapping) + r.ods.DeleteApplicationMappingFromStore(applicationMappingKey) + return ctrl.Result{}, nil + } + } else { + utils.SendCreateApplicationMappingEvent(applicationMapping) + } + } sendUpdates(applicationMappingList) return ctrl.Result{}, nil } diff --git a/common-controller/internal/operator/controllers/cp/subscription_controller.go b/common-controller/internal/operator/controllers/cp/subscription_controller.go index 13aaeaf8f..0933b37ff 100644 --- a/common-controller/internal/operator/controllers/cp/subscription_controller.go +++ b/common-controller/internal/operator/controllers/cp/subscription_controller.go @@ -22,10 +22,12 @@ import ( "fmt" "github.com/wso2/apk/adapter/pkg/logging" + "github.com/wso2/apk/common-controller/internal/cache" loggers "github.com/wso2/apk/common-controller/internal/loggers" constants "github.com/wso2/apk/common-controller/internal/operator/constant" "github.com/wso2/apk/common-controller/internal/server" "github.com/wso2/apk/common-controller/internal/utils" + k8error "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -44,12 +46,14 @@ import ( type SubscriptionReconciler struct { client client.Client Scheme *runtime.Scheme + ods *cache.SubscriptionDataStore } // NewSubscriptionController creates a new Subscription controller instance. -func NewSubscriptionController(mgr manager.Manager) error { +func NewSubscriptionController(mgr manager.Manager, subscriptionStore *cache.SubscriptionDataStore) error { r := &SubscriptionReconciler{ client: mgr.GetClient(), + ods: subscriptionStore, } c, err := controller.New(constants.SubscriptionController, mgr, controller.Options{Reconciler: r}) if err != nil { @@ -92,6 +96,22 @@ func (subscriptionReconciler *SubscriptionReconciler) Reconcile(ctx context.Cont subscriptionKey.Namespace, subscriptionKey.Name) } sendSubUpdates(subscriptionList) + var subscription cpv1alpha2.Subscription + if err := subscriptionReconciler.client.Get(ctx, req.NamespacedName, &subscription); err != nil { + if k8error.IsNotFound(err) { + subscriptionSpec, state := subscriptionReconciler.ods.GetSubscriptionFromStore(subscriptionKey) + if state { + // Subscription in cache + loggers.LoggerAPKOperator.Debugf("Subscription %s/%s not found. Ignoring since object must be deleted", subscriptionKey.Namespace, subscriptionKey.Name) + utils.SendDeleteSubscriptionEvent(subscriptionKey.Name, subscriptionSpec) + subscriptionReconciler.ods.DeleteSubscriptionFromStore(subscriptionKey) + return ctrl.Result{}, nil + } + } else { + utils.SendAddSubscriptionEvent(subscription) + subscriptionReconciler.ods.AddorUpdateSubscriptionToStore(subscriptionKey, subscription.Spec) + } + } return ctrl.Result{}, nil } diff --git a/common-controller/internal/operator/operator.go b/common-controller/internal/operator/operator.go index b6e20627f..8518f327f 100644 --- a/common-controller/internal/operator/operator.go +++ b/common-controller/internal/operator/operator.go @@ -76,6 +76,7 @@ func InitOperator() { ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) ratelimitStore := cache.CreateNewOperatorDataStore() + subscriptionStore := cache.CreateNewSubscriptionDataStore() mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, MetricsBindAddress: metricsAddr, @@ -133,15 +134,15 @@ func InitOperator() { loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error3114, logging.MAJOR, "Error creating JWT Issuer controller, error: %v", err)) } - if err := cpcontrollers.NewApplicationController(mgr); err != nil { + if err := cpcontrollers.NewApplicationController(mgr, subscriptionStore); err != nil { loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error3115, logging.MAJOR, "Error creating Application controller, error: %v", err)) } - if err := cpcontrollers.NewSubscriptionController(mgr); err != nil { + if err := cpcontrollers.NewSubscriptionController(mgr, subscriptionStore); err != nil { loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error3116, logging.MAJOR, "Error creating Subscription controller, error: %v", err)) } - if err := cpcontrollers.NewApplicationMappingController(mgr); err != nil { + if err := cpcontrollers.NewApplicationMappingController(mgr, subscriptionStore); err != nil { loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error3117, logging.MAJOR, "Error creating Application Mapping controller, error: %v", err)) } diff --git a/common-controller/internal/server/event_server.go b/common-controller/internal/server/event_server.go new file mode 100644 index 000000000..16aa18e3f --- /dev/null +++ b/common-controller/internal/server/event_server.go @@ -0,0 +1,37 @@ +package server + +import ( + "log" + + apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" + utils "github.com/wso2/apk/common-controller/internal/utils" + "google.golang.org/grpc/metadata" +) + +// EventServer struct use to hold event server +type EventServer struct { + apkmgt.UnimplementedEventStreamServiceServer +} + +// StreamEvents streams events to the enforcer +func (s EventServer) StreamEvents(req *apkmgt.Request, srv apkmgt.EventStreamService_StreamEventsServer) error { + // Read metadata from the request context + md, ok := metadata.FromIncomingContext(srv.Context()) + if !ok { + log.Printf("missing metadata") + return nil + // Handle the case where metadata is not present + } + enforcerID := md.Get("enforcer-uuid") + utils.AddClientConnection(enforcerID[0], srv) + for { + if srv.Context().Done() == nil { + utils.DeleteClientConnection(enforcerID[0]) + return nil // Client closed the connection + } else if srv.Context().Err() != nil { + log.Printf("error : %v", srv.Context().Err()) + utils.DeleteClientConnection(enforcerID[0]) + return nil + } + } +} diff --git a/common-controller/internal/utils/enforcer_connection_holder.go b/common-controller/internal/utils/enforcer_connection_holder.go new file mode 100644 index 000000000..6db90a035 --- /dev/null +++ b/common-controller/internal/utils/enforcer_connection_holder.go @@ -0,0 +1,22 @@ +package utils + +import ( + apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" +) + +var clientConnections = make(map[string]apkmgt.EventStreamService_StreamEventsServer) + +// AddClientConnection adds a client connection to the map +func AddClientConnection(clientID string, stream apkmgt.EventStreamService_StreamEventsServer) { + clientConnections[clientID] = stream +} + +// DeleteClientConnection deletes a client connection from the map +func DeleteClientConnection(clientID string) { + delete(clientConnections, clientID) +} + +// GetAllClientConnections returns all client connections +func GetAllClientConnections() map[string]apkmgt.EventStreamService_StreamEventsServer { + return clientConnections +} diff --git a/common-controller/internal/utils/event_utils.go b/common-controller/internal/utils/event_utils.go new file mode 100644 index 000000000..4adc378ac --- /dev/null +++ b/common-controller/internal/utils/event_utils.go @@ -0,0 +1,199 @@ +package utils + +import ( + time "time" + + "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" + "github.com/wso2/apk/common-controller/internal/loggers" + cpv1alpha2 "github.com/wso2/apk/common-controller/internal/operator/apis/cp/v1alpha2" + constants "github.com/wso2/apk/common-controller/internal/operator/constant" +) + +// SendAppDeletionEvent sends an application creation event to the enforcer +func SendAppDeletionEvent(applicationUUID string, applicationSpec cpv1alpha2.ApplicationSpec) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + event := subscription.Event{ + Uuid: applicationUUID, + Type: constants.APPLICATION_DELETED, + TimeStamp: milliseconds, + Application: &subscription.Application{ + Uuid: applicationUUID, + Name: applicationSpec.Name, + Owner: applicationSpec.Owner, + Organization: applicationSpec.Organization, + Attributes: applicationSpec.Attributes, + }, + } + sendEvent(event) +} + +// SendAppUpdateEvent sends an application update event to the enforcer +func SendAppUpdateEvent(applicationUUID string, oldApplicationSpec cpv1alpha2.ApplicationSpec, newApplicationSpec cpv1alpha2.ApplicationSpec) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + event := subscription.Event{ + Uuid: applicationUUID, + Type: constants.APPLICATION_UPDATED, + TimeStamp: milliseconds, + Application: &subscription.Application{ + Uuid: applicationUUID, + Name: newApplicationSpec.Name, + Owner: newApplicationSpec.Owner, + Organization: newApplicationSpec.Organization, + Attributes: newApplicationSpec.Attributes, + }, + } + sendEvent(event) + SendDeleteApplicationKeyMappingEvent(applicationUUID, oldApplicationSpec) + SendApplicationKeyMappingEvent(applicationUUID, newApplicationSpec) +} + +// SendAddApplicationEvent sends an application creation event to the enforcer +func SendAddApplicationEvent(application cpv1alpha2.Application) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + event := subscription.Event{ + Uuid: application.ObjectMeta.Name, + Type: constants.APPLICATION_CREATED, + TimeStamp: milliseconds, + Application: &subscription.Application{ + Uuid: application.ObjectMeta.Name, + Name: application.Spec.Name, + Owner: application.Spec.Owner, + Organization: application.Spec.Organization, + Attributes: application.Spec.Attributes, + }, + } + sendEvent(event) +} + +// SendAddSubscriptionEvent sends an subscription creation event to the enforcer +func SendAddSubscriptionEvent(sub cpv1alpha2.Subscription) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + event := subscription.Event{ + Uuid: sub.ObjectMeta.Name, + Type: constants.SUBSCRIPTION_CREATED, + TimeStamp: milliseconds, + Subscription: &subscription.Subscription{ + Uuid: sub.ObjectMeta.Name, + SubStatus: sub.Spec.SubscriptionStatus, + Organization: sub.Spec.Organization, + SubscribedApi: &subscription.SubscribedAPI{ + Name: sub.Spec.API.Name, + Version: sub.Spec.API.Version, + }, + }, + } + sendEvent(event) +} + +// SendDeleteSubscriptionEvent sends an subscription deletion event to the enforcer +func SendDeleteSubscriptionEvent(subscriptionUUID string, subscriptionSpec cpv1alpha2.SubscriptionSpec) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + event := subscription.Event{ + Uuid: subscriptionUUID, + Type: constants.SUBSCRIPTION_DELETED, + TimeStamp: milliseconds, + Subscription: &subscription.Subscription{ + Uuid: subscriptionUUID, + SubStatus: subscriptionSpec.SubscriptionStatus, + Organization: subscriptionSpec.Organization, + SubscribedApi: &subscription.SubscribedAPI{ + Name: subscriptionSpec.API.Name, + Version: subscriptionSpec.API.Version, + }, + }, + } + sendEvent(event) +} + +// SendCreateApplicationMappingEvent sends an application mapping event to the enforcer +func SendCreateApplicationMappingEvent(applicationMapping cpv1alpha2.ApplicationMapping) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + event := subscription.Event{ + Uuid: applicationMapping.ObjectMeta.Name, + Type: constants.APPLICATION_MAPPING_CREATED, + TimeStamp: milliseconds, + ApplicationMapping: &subscription.ApplicationMapping{ + Uuid: applicationMapping.ObjectMeta.Name, + ApplicationRef: applicationMapping.Spec.ApplicationRef, + SubscriptionRef: applicationMapping.Spec.SubscriptionRef, + }, + } + sendEvent(event) +} + +// SendDeleteApplicationMappingEvent sends an application mapping deletion event to the enforcer +func SendDeleteApplicationMappingEvent(applicationMappingUUID string, applicationMappingSpec cpv1alpha2.ApplicationMappingSpec) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + event := subscription.Event{ + Uuid: applicationMappingUUID, + Type: constants.APPLICATION_DELETED, + TimeStamp: milliseconds, + ApplicationMapping: &subscription.ApplicationMapping{ + Uuid: applicationMappingUUID, + ApplicationRef: applicationMappingSpec.ApplicationRef, + SubscriptionRef: applicationMappingSpec.SubscriptionRef, + }, + } + sendEvent(event) +} +func SendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKeyMapping cpv1alpha2.ApplicationSpec) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + var oauth2SecurityScheme = applicationKeyMapping.SecuritySchemes.OAuth2 + if oauth2SecurityScheme != nil { + for _, env := range oauth2SecurityScheme.Environments { + event := subscription.Event{ + Uuid: applicationUUID, + Type: constants.APPLICATION_KEY_MAPPING_DELETED, + TimeStamp: milliseconds, + ApplicationKeyMapping: &subscription.ApplicationKeyMapping{ + ApplicationUUID: applicationUUID, + SecurityScheme: constants.OAuth2, + ApplicationIdentifier: env.AppID, + KeyType: env.KeyType, + EnvID: env.EnvID, + }, + } + sendEvent(event) + } + } +} +func SendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1alpha2.ApplicationSpec) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + var oauth2SecurityScheme = applicationSpec.SecuritySchemes.OAuth2 + if oauth2SecurityScheme != nil { + for _, env := range oauth2SecurityScheme.Environments { + event := subscription.Event{ + Uuid: applicationUUID, + Type: constants.APPLICATION_KEY_MAPPING_CREATED, + TimeStamp: milliseconds, + ApplicationKeyMapping: &subscription.ApplicationKeyMapping{ + ApplicationUUID: applicationUUID, + SecurityScheme: constants.OAuth2, + ApplicationIdentifier: env.AppID, + KeyType: env.KeyType, + EnvID: env.EnvID, + }, + } + sendEvent(event) + } + } +} +func sendEvent(event subscription.Event) { + for clientId, stream := range GetAllClientConnections() { + err := stream.Send(&event) + if err != nil { + loggers.LoggerAPK.Errorf("Error sending event to client %s: %v", clientId, err) + } else { + loggers.LoggerAPK.Debugf("Event sent to client %s", clientId) + } + } +} diff --git a/common-controller/internal/xds/server.go b/common-controller/internal/xds/server.go index 9bd0ac587..af86e60b5 100644 --- a/common-controller/internal/xds/server.go +++ b/common-controller/internal/xds/server.go @@ -18,8 +18,6 @@ package xds import ( - "context" - crand "crypto/rand" "fmt" "math/big" "math/rand" @@ -33,31 +31,27 @@ import ( "github.com/envoyproxy/go-control-plane/pkg/cache/types" envoy_cachev3 "github.com/envoyproxy/go-control-plane/pkg/cache/v3" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" wso2_cache "github.com/wso2/apk/adapter/pkg/discovery/protocol/cache/v3" - wso2_resource "github.com/wso2/apk/adapter/pkg/discovery/protocol/resource/v3" eventhubTypes "github.com/wso2/apk/adapter/pkg/eventhub/types" - "github.com/wso2/apk/adapter/pkg/logging" - "github.com/wso2/apk/common-controller/internal/loggers" dpv1alpha1 "github.com/wso2/apk/common-controller/internal/operator/apis/dp/v1alpha1" ) // EnvoyInternalAPI struct use to hold envoy resources and adapter internal resources type EnvoyInternalAPI struct { // commonControllerInternalAPI model.commonControllerInternalAPI - envoyLabels []string - routes []*routev3.Route - clusters []*clusterv3.Cluster - endpointAddresses []*corev3.Address - enforcerAPI types.Resource + envoyLabels []string + routes []*routev3.Route + clusters []*clusterv3.Cluster + endpointAddresses []*corev3.Address + enforcerAPI types.Resource } // EnvoyGatewayConfig struct use to hold envoy gateway resources type EnvoyGatewayConfig struct { - listener *listenerv3.Listener - routeConfig *routev3.RouteConfiguration - clusters []*clusterv3.Cluster - endpoints []*corev3.Address + listener *listenerv3.Listener + routeConfig *routev3.RouteConfiguration + clusters []*clusterv3.Cluster + endpoints []*corev3.Address // customRateLimitPolicies []*model.CustomRateLimitPolicy } @@ -245,79 +239,3 @@ func GetEnforcerApplicationKeyMappingCache() wso2_cache.SnapshotCache { func GetEnforcerApplicationMappingCache() wso2_cache.SnapshotCache { return enforcerApplicationMappingCache } - -// UpdateEnforcerApplications sets new update to the enforcer's Applications -func UpdateEnforcerApplications(applications *subscription.ApplicationList) { - loggers.LoggerXds.Debug("Updating Enforcer Application Cache") - label := commonEnforcerLabel - applicationList := append(enforcerLabelMap[label].applications, applications) - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.ApplicationListType: applicationList, - }) - snap.Consistent() - errSetSnap := enforcerApplicationCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - loggers.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].applications = applicationList - loggers.LoggerXds.Infof("New Application cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - -// UpdateEnforcerApplicationKeyMappings sets new update to the enforcer's Application Key Mappings -func UpdateEnforcerApplicationKeyMappings(applicationKeyMappings *subscription.ApplicationKeyMappingList) { - loggers.LoggerXds.Debug("Updating Application Key Mapping Cache") - label := commonEnforcerLabel - applicationKeyMappingList := append(enforcerLabelMap[label].applicationKeyMappings, applicationKeyMappings) - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.ApplicationKeyMappingListType: applicationKeyMappingList, - }) - snap.Consistent() - errSetSnap := enforcerApplicationKeyMappingCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - loggers.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].applicationKeyMappings = applicationKeyMappingList - loggers.LoggerXds.Infof("New Application Key Mapping cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - -// UpdateEnforcerSubscriptions sets new update to the enforcer's Subscriptions -func UpdateEnforcerSubscriptions(subscriptions *subscription.SubscriptionList) { - //TODO: (Dinusha) check this hardcoded value - loggers.LoggerXds.Debug("Updating Enforcer Subscription Cache") - label := commonEnforcerLabel - subscriptionList := append(enforcerLabelMap[label].subscriptions, subscriptions) - - // TODO: (VirajSalaka) Decide if a map is required to keep version (just to avoid having the same version) - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.SubscriptionListType: subscriptionList, - }) - snap.Consistent() - - errSetSnap := enforcerSubscriptionCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - loggers.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].subscriptions = subscriptionList - loggers.LoggerXds.Infof("New Subscription cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - -// UpdateEnforcerApplicationMappings sets new update to the enforcer's Application Mappings -func UpdateEnforcerApplicationMappings(applicationMappings *subscription.ApplicationMappingList) { - loggers.LoggerXds.Debug("Updating Application Mapping Cache") - label := commonEnforcerLabel - applicationMappingList := append(enforcerLabelMap[label].applicationMappings, applicationMappings) - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.ApplicationMappingListType: applicationMappingList, - }) - snap.Consistent() - errSetSnap := enforcerApplicationMappingCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - loggers.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].applicationMappings = applicationMappingList - loggers.LoggerXds.Infof("New Application Mapping cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventServiceProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventServiceProto.java new file mode 100644 index 000000000..2ebf3bdcc --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventServiceProto.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/service/apkmgt/eventds.proto + +package org.wso2.apk.enforcer.discovery.service.apkmgt; + +public final class EventServiceProto { + private EventServiceProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_discovery_service_apkmgt_Request_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_discovery_service_apkmgt_Request_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n+wso2/discovery/service/apkmgt/eventds." + + "proto\022\030discovery.service.apkmgt\032\'wso2/di" + + "scovery/subscription/event.proto\"\030\n\007Requ" + + "est\022\r\n\005event\030\001 \001(\t2o\n\022EventStreamService" + + "\022Y\n\014StreamEvents\022!.discovery.service.apk" + + "mgt.Request\032\".wso2.discovery.subscriptio" + + "n.Event\"\0000\001B\225\001\n.org.wso2.apk.enforcer.di" + + "scovery.service.apkmgtB\021EventServiceProt" + + "oP\001ZKgithub.com/wso2/apk/adapter/pkg/dis" + + "covery/api/wso2/discovery/service/apkmgt" + + "\210\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.wso2.apk.enforcer.discovery.subscription.EventProto.getDescriptor(), + }); + internal_static_discovery_service_apkmgt_Request_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_discovery_service_apkmgt_Request_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_discovery_service_apkmgt_Request_descriptor, + new java.lang.String[] { "Event", }); + org.wso2.apk.enforcer.discovery.subscription.EventProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamService.java new file mode 100644 index 000000000..6e57e5bca --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamService.java @@ -0,0 +1,241 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/service/apkmgt/eventds.proto + +package org.wso2.apk.enforcer.discovery.service.apkmgt; + +/** + *
+ * [#protodoc-title: EventStreamDS]
+ * 
+ * + * Protobuf service {@code discovery.service.apkmgt.EventStreamService} + */ +public abstract class EventStreamService + implements com.google.protobuf.Service { + protected EventStreamService() {} + + public interface Interface { + /** + * rpc StreamEvents(.discovery.service.apkmgt.Request) returns (stream .wso2.discovery.subscription.Event); + */ + public abstract void streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, + com.google.protobuf.RpcCallback done); + + } + + public static com.google.protobuf.Service newReflectiveService( + final Interface impl) { + return new EventStreamService() { + @java.lang.Override + public void streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, + com.google.protobuf.RpcCallback done) { + impl.streamEvents(controller, request, done); + } + + }; + } + + public static com.google.protobuf.BlockingService + newReflectiveBlockingService(final BlockingInterface impl) { + return new com.google.protobuf.BlockingService() { + public final com.google.protobuf.Descriptors.ServiceDescriptor + getDescriptorForType() { + return getDescriptor(); + } + + public final com.google.protobuf.Message callBlockingMethod( + com.google.protobuf.Descriptors.MethodDescriptor method, + com.google.protobuf.RpcController controller, + com.google.protobuf.Message request) + throws com.google.protobuf.ServiceException { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.callBlockingMethod() given method descriptor for " + + "wrong service type."); + } + switch(method.getIndex()) { + case 0: + return impl.streamEvents(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.Request)request); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public final com.google.protobuf.Message + getRequestPrototype( + com.google.protobuf.Descriptors.MethodDescriptor method) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.getRequestPrototype() given method " + + "descriptor for wrong service type."); + } + switch(method.getIndex()) { + case 0: + return org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance(); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public final com.google.protobuf.Message + getResponsePrototype( + com.google.protobuf.Descriptors.MethodDescriptor method) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.getResponsePrototype() given method " + + "descriptor for wrong service type."); + } + switch(method.getIndex()) { + case 0: + return org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + }; + } + + /** + * rpc StreamEvents(.discovery.service.apkmgt.Request) returns (stream .wso2.discovery.subscription.Event); + */ + public abstract void streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, + com.google.protobuf.RpcCallback done); + + public static final + com.google.protobuf.Descriptors.ServiceDescriptor + getDescriptor() { + return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.getDescriptor().getServices().get(0); + } + public final com.google.protobuf.Descriptors.ServiceDescriptor + getDescriptorForType() { + return getDescriptor(); + } + + public final void callMethod( + com.google.protobuf.Descriptors.MethodDescriptor method, + com.google.protobuf.RpcController controller, + com.google.protobuf.Message request, + com.google.protobuf.RpcCallback< + com.google.protobuf.Message> done) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.callMethod() given method descriptor for wrong " + + "service type."); + } + switch(method.getIndex()) { + case 0: + this.streamEvents(controller, (org.wso2.apk.enforcer.discovery.service.apkmgt.Request)request, + com.google.protobuf.RpcUtil.specializeCallback( + done)); + return; + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public final com.google.protobuf.Message + getRequestPrototype( + com.google.protobuf.Descriptors.MethodDescriptor method) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.getRequestPrototype() given method " + + "descriptor for wrong service type."); + } + switch(method.getIndex()) { + case 0: + return org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance(); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public final com.google.protobuf.Message + getResponsePrototype( + com.google.protobuf.Descriptors.MethodDescriptor method) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.getResponsePrototype() given method " + + "descriptor for wrong service type."); + } + switch(method.getIndex()) { + case 0: + return org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public static Stub newStub( + com.google.protobuf.RpcChannel channel) { + return new Stub(channel); + } + + public static final class Stub extends org.wso2.apk.enforcer.discovery.service.apkmgt.EventStreamService implements Interface { + private Stub(com.google.protobuf.RpcChannel channel) { + this.channel = channel; + } + + private final com.google.protobuf.RpcChannel channel; + + public com.google.protobuf.RpcChannel getChannel() { + return channel; + } + + public void streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, + com.google.protobuf.RpcCallback done) { + channel.callMethod( + getDescriptor().getMethods().get(0), + controller, + request, + org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(), + com.google.protobuf.RpcUtil.generalizeCallback( + done, + org.wso2.apk.enforcer.discovery.subscription.Event.class, + org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance())); + } + } + + public static BlockingInterface newBlockingStub( + com.google.protobuf.BlockingRpcChannel channel) { + return new BlockingStub(channel); + } + + public interface BlockingInterface { + public org.wso2.apk.enforcer.discovery.subscription.Event streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.apkmgt.Request request) + throws com.google.protobuf.ServiceException; + } + + private static final class BlockingStub implements BlockingInterface { + private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { + this.channel = channel; + } + + private final com.google.protobuf.BlockingRpcChannel channel; + + public org.wso2.apk.enforcer.discovery.subscription.Event streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.apkmgt.Request request) + throws com.google.protobuf.ServiceException { + return (org.wso2.apk.enforcer.discovery.subscription.Event) channel.callBlockingMethod( + getDescriptor().getMethods().get(0), + controller, + request, + org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance()); + } + + } + + // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.EventStreamService) +} + diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamServiceGrpc.java new file mode 100644 index 000000000..dffec9ee4 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/EventStreamServiceGrpc.java @@ -0,0 +1,296 @@ +package org.wso2.apk.enforcer.discovery.service.apkmgt; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * [#protodoc-title: EventStreamDS]
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: wso2/discovery/service/apkmgt/eventds.proto") +public final class EventStreamServiceGrpc { + + private EventStreamServiceGrpc() {} + + public static final String SERVICE_NAME = "discovery.service.apkmgt.EventStreamService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getStreamEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamEvents", + requestType = org.wso2.apk.enforcer.discovery.service.apkmgt.Request.class, + responseType = org.wso2.apk.enforcer.discovery.subscription.Event.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getStreamEventsMethod() { + io.grpc.MethodDescriptor getStreamEventsMethod; + if ((getStreamEventsMethod = EventStreamServiceGrpc.getStreamEventsMethod) == null) { + synchronized (EventStreamServiceGrpc.class) { + if ((getStreamEventsMethod = EventStreamServiceGrpc.getStreamEventsMethod) == null) { + EventStreamServiceGrpc.getStreamEventsMethod = getStreamEventsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance())) + .setSchemaDescriptor(new EventStreamServiceMethodDescriptorSupplier("StreamEvents")) + .build(); + } + } + } + return getStreamEventsMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static EventStreamServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EventStreamServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceStub(channel, callOptions); + } + }; + return EventStreamServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EventStreamServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EventStreamServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceBlockingStub(channel, callOptions); + } + }; + return EventStreamServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static EventStreamServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EventStreamServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceFutureStub(channel, callOptions); + } + }; + return EventStreamServiceFutureStub.newStub(factory, channel); + } + + /** + *
+   * [#protodoc-title: EventStreamDS]
+   * 
+ */ + public static abstract class EventStreamServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void streamEvents(org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getStreamEventsMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamEventsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + org.wso2.apk.enforcer.discovery.service.apkmgt.Request, + org.wso2.apk.enforcer.discovery.subscription.Event>( + this, METHODID_STREAM_EVENTS))) + .build(); + } + } + + /** + *
+   * [#protodoc-title: EventStreamDS]
+   * 
+ */ + public static final class EventStreamServiceStub extends io.grpc.stub.AbstractAsyncStub { + private EventStreamServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EventStreamServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceStub(channel, callOptions); + } + + /** + */ + public void streamEvents(org.wso2.apk.enforcer.discovery.service.apkmgt.Request request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getStreamEventsMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * [#protodoc-title: EventStreamDS]
+   * 
+ */ + public static final class EventStreamServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private EventStreamServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EventStreamServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceBlockingStub(channel, callOptions); + } + + /** + */ + public java.util.Iterator streamEvents( + org.wso2.apk.enforcer.discovery.service.apkmgt.Request request) { + return blockingServerStreamingCall( + getChannel(), getStreamEventsMethod(), getCallOptions(), request); + } + } + + /** + *
+   * [#protodoc-title: EventStreamDS]
+   * 
+ */ + public static final class EventStreamServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + private EventStreamServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EventStreamServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceFutureStub(channel, callOptions); + } + } + + private static final int METHODID_STREAM_EVENTS = 0; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final EventStreamServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(EventStreamServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_STREAM_EVENTS: + serviceImpl.streamEvents((org.wso2.apk.enforcer.discovery.service.apkmgt.Request) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class EventStreamServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EventStreamServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("EventStreamService"); + } + } + + private static final class EventStreamServiceFileDescriptorSupplier + extends EventStreamServiceBaseDescriptorSupplier { + EventStreamServiceFileDescriptorSupplier() {} + } + + private static final class EventStreamServiceMethodDescriptorSupplier + extends EventStreamServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + EventStreamServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (EventStreamServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EventStreamServiceFileDescriptorSupplier()) + .addMethod(getStreamEventsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/Request.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/Request.java new file mode 100644 index 000000000..bd03bb036 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/Request.java @@ -0,0 +1,557 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/service/apkmgt/eventds.proto + +package org.wso2.apk.enforcer.discovery.service.apkmgt; + +/** + * Protobuf type {@code discovery.service.apkmgt.Request} + */ +public final class Request extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.Request) + RequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use Request.newBuilder() to construct. + private Request(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Request() { + event_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Request(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Request( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + event_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.enforcer.discovery.service.apkmgt.Request.class, org.wso2.apk.enforcer.discovery.service.apkmgt.Request.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private volatile java.lang.Object event_; + /** + * string event = 1; + * @return The event. + */ + @java.lang.Override + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } + } + /** + * string event = 1; + * @return The bytes for event. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getEventBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, event_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEventBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, event_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.Request)) { + return super.equals(obj); + } + org.wso2.apk.enforcer.discovery.service.apkmgt.Request other = (org.wso2.apk.enforcer.discovery.service.apkmgt.Request) obj; + + if (!getEvent() + .equals(other.getEvent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.apkmgt.Request prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code discovery.service.apkmgt.Request} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.Request) + org.wso2.apk.enforcer.discovery.service.apkmgt.RequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.enforcer.discovery.service.apkmgt.Request.class, org.wso2.apk.enforcer.discovery.service.apkmgt.Request.Builder.class); + } + + // Construct using org.wso2.apk.enforcer.discovery.service.apkmgt.Request.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + event_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.wso2.apk.enforcer.discovery.service.apkmgt.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.service.apkmgt.Request getDefaultInstanceForType() { + return org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance(); + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.service.apkmgt.Request build() { + org.wso2.apk.enforcer.discovery.service.apkmgt.Request result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.service.apkmgt.Request buildPartial() { + org.wso2.apk.enforcer.discovery.service.apkmgt.Request result = new org.wso2.apk.enforcer.discovery.service.apkmgt.Request(this); + result.event_ = event_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.wso2.apk.enforcer.discovery.service.apkmgt.Request) { + return mergeFrom((org.wso2.apk.enforcer.discovery.service.apkmgt.Request)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.apkmgt.Request other) { + if (other == org.wso2.apk.enforcer.discovery.service.apkmgt.Request.getDefaultInstance()) return this; + if (!other.getEvent().isEmpty()) { + event_ = other.event_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.wso2.apk.enforcer.discovery.service.apkmgt.Request parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.wso2.apk.enforcer.discovery.service.apkmgt.Request) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object event_ = ""; + /** + * string event = 1; + * @return The event. + */ + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string event = 1; + * @return The bytes for event. + */ + public com.google.protobuf.ByteString + getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string event = 1; + * @param value The event to set. + * @return This builder for chaining. + */ + public Builder setEvent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + event_ = value; + onChanged(); + return this; + } + /** + * string event = 1; + * @return This builder for chaining. + */ + public Builder clearEvent() { + + event_ = getDefaultInstance().getEvent(); + onChanged(); + return this; + } + /** + * string event = 1; + * @param value The bytes for event to set. + * @return This builder for chaining. + */ + public Builder setEventBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + event_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.Request) + } + + // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.Request) + private static final org.wso2.apk.enforcer.discovery.service.apkmgt.Request DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.apkmgt.Request(); + } + + public static org.wso2.apk.enforcer.discovery.service.apkmgt.Request getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Request parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Request(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.service.apkmgt.Request getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/RequestOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/RequestOrBuilder.java new file mode 100644 index 000000000..e7e08f0e4 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/apkmgt/RequestOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/service/apkmgt/eventds.proto + +package org.wso2.apk.enforcer.discovery.service.apkmgt; + +public interface RequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.Request) + com.google.protobuf.MessageOrBuilder { + + /** + * string event = 1; + * @return The event. + */ + java.lang.String getEvent(); + /** + * string event = 1; + * @return The bytes for event. + */ + com.google.protobuf.ByteString + getEventBytes(); +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventServiceProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventServiceProto.java new file mode 100644 index 000000000..f671cf88a --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventServiceProto.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/service/apkmgt/eventds.proto + +package org.wso2.apk.enforcer.discovery.service.subscription; + +public final class EventServiceProto { + private EventServiceProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_discovery_service_apkmgt_Request_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_discovery_service_apkmgt_Request_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n+wso2/discovery/service/apkmgt/eventds." + + "proto\022\030discovery.service.apkmgt\032\'wso2/di" + + "scovery/subscription/event.proto\"\030\n\007Requ" + + "est\022\r\n\005event\030\001 \001(\t2o\n\022EventStreamService" + + "\022Y\n\014StreamEvents\022!.discovery.service.apk" + + "mgt.Request\032\".wso2.discovery.subscriptio" + + "n.Event\"\0000\001B\232\001\n4org.wso2.apk.enforcer.di" + + "scovery.service.subscriptionB\021EventServi" + + "ceProtoP\001ZJgithub.com/envoyproxy/go-cont" + + "rol-plane/wso2/discovery/service/subscri" + + "ption\210\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.wso2.apk.enforcer.discovery.subscription.EventProto.getDescriptor(), + }); + internal_static_discovery_service_apkmgt_Request_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_discovery_service_apkmgt_Request_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_discovery_service_apkmgt_Request_descriptor, + new java.lang.String[] { "Event", }); + org.wso2.apk.enforcer.discovery.subscription.EventProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventStreamService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventStreamService.java new file mode 100644 index 000000000..29506a60f --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventStreamService.java @@ -0,0 +1,241 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/service/apkmgt/eventds.proto + +package org.wso2.apk.enforcer.discovery.service.subscription; + +/** + *
+ * [#protodoc-title: EventStreamDS]
+ * 
+ * + * Protobuf service {@code discovery.service.apkmgt.EventStreamService} + */ +public abstract class EventStreamService + implements com.google.protobuf.Service { + protected EventStreamService() {} + + public interface Interface { + /** + * rpc StreamEvents(.discovery.service.apkmgt.Request) returns (stream .wso2.discovery.subscription.Event); + */ + public abstract void streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.subscription.Request request, + com.google.protobuf.RpcCallback done); + + } + + public static com.google.protobuf.Service newReflectiveService( + final Interface impl) { + return new EventStreamService() { + @java.lang.Override + public void streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.subscription.Request request, + com.google.protobuf.RpcCallback done) { + impl.streamEvents(controller, request, done); + } + + }; + } + + public static com.google.protobuf.BlockingService + newReflectiveBlockingService(final BlockingInterface impl) { + return new com.google.protobuf.BlockingService() { + public final com.google.protobuf.Descriptors.ServiceDescriptor + getDescriptorForType() { + return getDescriptor(); + } + + public final com.google.protobuf.Message callBlockingMethod( + com.google.protobuf.Descriptors.MethodDescriptor method, + com.google.protobuf.RpcController controller, + com.google.protobuf.Message request) + throws com.google.protobuf.ServiceException { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.callBlockingMethod() given method descriptor for " + + "wrong service type."); + } + switch(method.getIndex()) { + case 0: + return impl.streamEvents(controller, (org.wso2.apk.enforcer.discovery.service.subscription.Request)request); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public final com.google.protobuf.Message + getRequestPrototype( + com.google.protobuf.Descriptors.MethodDescriptor method) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.getRequestPrototype() given method " + + "descriptor for wrong service type."); + } + switch(method.getIndex()) { + case 0: + return org.wso2.apk.enforcer.discovery.service.subscription.Request.getDefaultInstance(); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public final com.google.protobuf.Message + getResponsePrototype( + com.google.protobuf.Descriptors.MethodDescriptor method) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.getResponsePrototype() given method " + + "descriptor for wrong service type."); + } + switch(method.getIndex()) { + case 0: + return org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + }; + } + + /** + * rpc StreamEvents(.discovery.service.apkmgt.Request) returns (stream .wso2.discovery.subscription.Event); + */ + public abstract void streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.subscription.Request request, + com.google.protobuf.RpcCallback done); + + public static final + com.google.protobuf.Descriptors.ServiceDescriptor + getDescriptor() { + return org.wso2.apk.enforcer.discovery.service.subscription.EventServiceProto.getDescriptor().getServices().get(0); + } + public final com.google.protobuf.Descriptors.ServiceDescriptor + getDescriptorForType() { + return getDescriptor(); + } + + public final void callMethod( + com.google.protobuf.Descriptors.MethodDescriptor method, + com.google.protobuf.RpcController controller, + com.google.protobuf.Message request, + com.google.protobuf.RpcCallback< + com.google.protobuf.Message> done) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.callMethod() given method descriptor for wrong " + + "service type."); + } + switch(method.getIndex()) { + case 0: + this.streamEvents(controller, (org.wso2.apk.enforcer.discovery.service.subscription.Request)request, + com.google.protobuf.RpcUtil.specializeCallback( + done)); + return; + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public final com.google.protobuf.Message + getRequestPrototype( + com.google.protobuf.Descriptors.MethodDescriptor method) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.getRequestPrototype() given method " + + "descriptor for wrong service type."); + } + switch(method.getIndex()) { + case 0: + return org.wso2.apk.enforcer.discovery.service.subscription.Request.getDefaultInstance(); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public final com.google.protobuf.Message + getResponsePrototype( + com.google.protobuf.Descriptors.MethodDescriptor method) { + if (method.getService() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "Service.getResponsePrototype() given method " + + "descriptor for wrong service type."); + } + switch(method.getIndex()) { + case 0: + return org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(); + default: + throw new java.lang.AssertionError("Can't get here."); + } + } + + public static Stub newStub( + com.google.protobuf.RpcChannel channel) { + return new Stub(channel); + } + + public static final class Stub extends org.wso2.apk.enforcer.discovery.service.subscription.EventStreamService implements Interface { + private Stub(com.google.protobuf.RpcChannel channel) { + this.channel = channel; + } + + private final com.google.protobuf.RpcChannel channel; + + public com.google.protobuf.RpcChannel getChannel() { + return channel; + } + + public void streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.subscription.Request request, + com.google.protobuf.RpcCallback done) { + channel.callMethod( + getDescriptor().getMethods().get(0), + controller, + request, + org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(), + com.google.protobuf.RpcUtil.generalizeCallback( + done, + org.wso2.apk.enforcer.discovery.subscription.Event.class, + org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance())); + } + } + + public static BlockingInterface newBlockingStub( + com.google.protobuf.BlockingRpcChannel channel) { + return new BlockingStub(channel); + } + + public interface BlockingInterface { + public org.wso2.apk.enforcer.discovery.subscription.Event streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.subscription.Request request) + throws com.google.protobuf.ServiceException; + } + + private static final class BlockingStub implements BlockingInterface { + private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) { + this.channel = channel; + } + + private final com.google.protobuf.BlockingRpcChannel channel; + + public org.wso2.apk.enforcer.discovery.subscription.Event streamEvents( + com.google.protobuf.RpcController controller, + org.wso2.apk.enforcer.discovery.service.subscription.Request request) + throws com.google.protobuf.ServiceException { + return (org.wso2.apk.enforcer.discovery.subscription.Event) channel.callBlockingMethod( + getDescriptor().getMethods().get(0), + controller, + request, + org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance()); + } + + } + + // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.EventStreamService) +} + diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventStreamServiceGrpc.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventStreamServiceGrpc.java new file mode 100644 index 000000000..5ae47c183 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/EventStreamServiceGrpc.java @@ -0,0 +1,296 @@ +package org.wso2.apk.enforcer.discovery.service.subscription; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * [#protodoc-title: EventStreamDS]
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: wso2/discovery/service/apkmgt/eventds.proto") +public final class EventStreamServiceGrpc { + + private EventStreamServiceGrpc() {} + + public static final String SERVICE_NAME = "discovery.service.apkmgt.EventStreamService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getStreamEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamEvents", + requestType = org.wso2.apk.enforcer.discovery.service.subscription.Request.class, + responseType = org.wso2.apk.enforcer.discovery.subscription.Event.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getStreamEventsMethod() { + io.grpc.MethodDescriptor getStreamEventsMethod; + if ((getStreamEventsMethod = EventStreamServiceGrpc.getStreamEventsMethod) == null) { + synchronized (EventStreamServiceGrpc.class) { + if ((getStreamEventsMethod = EventStreamServiceGrpc.getStreamEventsMethod) == null) { + EventStreamServiceGrpc.getStreamEventsMethod = getStreamEventsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.wso2.apk.enforcer.discovery.service.subscription.Request.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance())) + .setSchemaDescriptor(new EventStreamServiceMethodDescriptorSupplier("StreamEvents")) + .build(); + } + } + } + return getStreamEventsMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static EventStreamServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EventStreamServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceStub(channel, callOptions); + } + }; + return EventStreamServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EventStreamServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EventStreamServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceBlockingStub(channel, callOptions); + } + }; + return EventStreamServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static EventStreamServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EventStreamServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceFutureStub(channel, callOptions); + } + }; + return EventStreamServiceFutureStub.newStub(factory, channel); + } + + /** + *
+   * [#protodoc-title: EventStreamDS]
+   * 
+ */ + public static abstract class EventStreamServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void streamEvents(org.wso2.apk.enforcer.discovery.service.subscription.Request request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getStreamEventsMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getStreamEventsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + org.wso2.apk.enforcer.discovery.service.subscription.Request, + org.wso2.apk.enforcer.discovery.subscription.Event>( + this, METHODID_STREAM_EVENTS))) + .build(); + } + } + + /** + *
+   * [#protodoc-title: EventStreamDS]
+   * 
+ */ + public static final class EventStreamServiceStub extends io.grpc.stub.AbstractAsyncStub { + private EventStreamServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EventStreamServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceStub(channel, callOptions); + } + + /** + */ + public void streamEvents(org.wso2.apk.enforcer.discovery.service.subscription.Request request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getStreamEventsMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * [#protodoc-title: EventStreamDS]
+   * 
+ */ + public static final class EventStreamServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private EventStreamServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EventStreamServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceBlockingStub(channel, callOptions); + } + + /** + */ + public java.util.Iterator streamEvents( + org.wso2.apk.enforcer.discovery.service.subscription.Request request) { + return blockingServerStreamingCall( + getChannel(), getStreamEventsMethod(), getCallOptions(), request); + } + } + + /** + *
+   * [#protodoc-title: EventStreamDS]
+   * 
+ */ + public static final class EventStreamServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + private EventStreamServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EventStreamServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EventStreamServiceFutureStub(channel, callOptions); + } + } + + private static final int METHODID_STREAM_EVENTS = 0; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final EventStreamServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(EventStreamServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_STREAM_EVENTS: + serviceImpl.streamEvents((org.wso2.apk.enforcer.discovery.service.subscription.Request) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class EventStreamServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EventStreamServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return org.wso2.apk.enforcer.discovery.service.subscription.EventServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("EventStreamService"); + } + } + + private static final class EventStreamServiceFileDescriptorSupplier + extends EventStreamServiceBaseDescriptorSupplier { + EventStreamServiceFileDescriptorSupplier() {} + } + + private static final class EventStreamServiceMethodDescriptorSupplier + extends EventStreamServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + EventStreamServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (EventStreamServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EventStreamServiceFileDescriptorSupplier()) + .addMethod(getStreamEventsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/Request.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/Request.java new file mode 100644 index 000000000..14694e3e4 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/Request.java @@ -0,0 +1,557 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/service/apkmgt/eventds.proto + +package org.wso2.apk.enforcer.discovery.service.subscription; + +/** + * Protobuf type {@code discovery.service.apkmgt.Request} + */ +public final class Request extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:discovery.service.apkmgt.Request) + RequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use Request.newBuilder() to construct. + private Request(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Request() { + event_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Request(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Request( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + event_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.wso2.apk.enforcer.discovery.service.subscription.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.wso2.apk.enforcer.discovery.service.subscription.EventServiceProto.internal_static_discovery_service_apkmgt_Request_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.enforcer.discovery.service.subscription.Request.class, org.wso2.apk.enforcer.discovery.service.subscription.Request.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private volatile java.lang.Object event_; + /** + * string event = 1; + * @return The event. + */ + @java.lang.Override + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } + } + /** + * string event = 1; + * @return The bytes for event. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getEventBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, event_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEventBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, event_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.wso2.apk.enforcer.discovery.service.subscription.Request)) { + return super.equals(obj); + } + org.wso2.apk.enforcer.discovery.service.subscription.Request other = (org.wso2.apk.enforcer.discovery.service.subscription.Request) obj; + + if (!getEvent() + .equals(other.getEvent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.service.subscription.Request parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.wso2.apk.enforcer.discovery.service.subscription.Request prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code discovery.service.apkmgt.Request} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:discovery.service.apkmgt.Request) + org.wso2.apk.enforcer.discovery.service.subscription.RequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.wso2.apk.enforcer.discovery.service.subscription.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.wso2.apk.enforcer.discovery.service.subscription.EventServiceProto.internal_static_discovery_service_apkmgt_Request_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.enforcer.discovery.service.subscription.Request.class, org.wso2.apk.enforcer.discovery.service.subscription.Request.Builder.class); + } + + // Construct using org.wso2.apk.enforcer.discovery.service.subscription.Request.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + event_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.wso2.apk.enforcer.discovery.service.subscription.EventServiceProto.internal_static_discovery_service_apkmgt_Request_descriptor; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.service.subscription.Request getDefaultInstanceForType() { + return org.wso2.apk.enforcer.discovery.service.subscription.Request.getDefaultInstance(); + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.service.subscription.Request build() { + org.wso2.apk.enforcer.discovery.service.subscription.Request result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.service.subscription.Request buildPartial() { + org.wso2.apk.enforcer.discovery.service.subscription.Request result = new org.wso2.apk.enforcer.discovery.service.subscription.Request(this); + result.event_ = event_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.wso2.apk.enforcer.discovery.service.subscription.Request) { + return mergeFrom((org.wso2.apk.enforcer.discovery.service.subscription.Request)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.wso2.apk.enforcer.discovery.service.subscription.Request other) { + if (other == org.wso2.apk.enforcer.discovery.service.subscription.Request.getDefaultInstance()) return this; + if (!other.getEvent().isEmpty()) { + event_ = other.event_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.wso2.apk.enforcer.discovery.service.subscription.Request parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.wso2.apk.enforcer.discovery.service.subscription.Request) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object event_ = ""; + /** + * string event = 1; + * @return The event. + */ + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string event = 1; + * @return The bytes for event. + */ + public com.google.protobuf.ByteString + getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string event = 1; + * @param value The event to set. + * @return This builder for chaining. + */ + public Builder setEvent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + event_ = value; + onChanged(); + return this; + } + /** + * string event = 1; + * @return This builder for chaining. + */ + public Builder clearEvent() { + + event_ = getDefaultInstance().getEvent(); + onChanged(); + return this; + } + /** + * string event = 1; + * @param value The bytes for event to set. + * @return This builder for chaining. + */ + public Builder setEventBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + event_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:discovery.service.apkmgt.Request) + } + + // @@protoc_insertion_point(class_scope:discovery.service.apkmgt.Request) + private static final org.wso2.apk.enforcer.discovery.service.subscription.Request DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.service.subscription.Request(); + } + + public static org.wso2.apk.enforcer.discovery.service.subscription.Request getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Request parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Request(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.service.subscription.Request getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/RequestOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/RequestOrBuilder.java new file mode 100644 index 000000000..d4e1e8ad1 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/service/subscription/RequestOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/service/apkmgt/eventds.proto + +package org.wso2.apk.enforcer.discovery.service.subscription; + +public interface RequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:discovery.service.apkmgt.Request) + com.google.protobuf.MessageOrBuilder { + + /** + * string event = 1; + * @return The event. + */ + java.lang.String getEvent(); + /** + * string event = 1; + * @return The bytes for event. + */ + com.google.protobuf.ByteString + getEventBytes(); +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Application.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Application.java index 907e16b6f..48b681eaa 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Application.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Application.java @@ -23,6 +23,7 @@ private Application() { uuid_ = ""; name_ = ""; owner_ = ""; + organization_ = ""; } @java.lang.Override @@ -75,6 +76,12 @@ private Application( break; } case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + organization_ = s; + break; + } + case 42: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { attributes_ = com.google.protobuf.MapField.newMapField( AttributesDefaultEntryHolder.defaultEntry); @@ -116,7 +123,7 @@ private Application( protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { - case 4: + case 5: return internalGetAttributes(); default: throw new RuntimeException( @@ -245,7 +252,45 @@ public java.lang.String getOwner() { } } - public static final int ATTRIBUTES_FIELD_NUMBER = 4; + public static final int ORGANIZATION_FIELD_NUMBER = 4; + private volatile java.lang.Object organization_; + /** + * string organization = 4; + * @return The organization. + */ + @java.lang.Override + public java.lang.String getOrganization() { + java.lang.Object ref = organization_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organization_ = s; + return s; + } + } + /** + * string organization = 4; + * @return The bytes for organization. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOrganizationBytes() { + java.lang.Object ref = organization_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + organization_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 5; private static final class AttributesDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.String, java.lang.String> defaultEntry = @@ -272,7 +317,7 @@ public int getAttributesCount() { return internalGetAttributes().getMap().size(); } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ @java.lang.Override @@ -290,7 +335,7 @@ public java.util.Map getAttributes() { return getAttributesMap(); } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ @java.lang.Override @@ -298,7 +343,7 @@ public java.util.Map getAttributesMap() { return internalGetAttributes().getMap(); } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ @java.lang.Override @@ -311,7 +356,7 @@ public java.lang.String getAttributesOrDefault( return map.containsKey(key) ? map.get(key) : defaultValue; } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ @java.lang.Override @@ -349,12 +394,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getOwnerBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, owner_); } + if (!getOrganizationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, organization_); + } com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, - 4); + 5); unknownFields.writeTo(output); } @@ -373,6 +421,9 @@ public int getSerializedSize() { if (!getOwnerBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, owner_); } + if (!getOrganizationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, organization_); + } for (java.util.Map.Entry entry : internalGetAttributes().getMap().entrySet()) { com.google.protobuf.MapEntry @@ -381,7 +432,7 @@ public int getSerializedSize() { .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, attributes__); + .computeMessageSize(5, attributes__); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -404,6 +455,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getName())) return false; if (!getOwner() .equals(other.getOwner())) return false; + if (!getOrganization() + .equals(other.getOrganization())) return false; if (!internalGetAttributes().equals( other.internalGetAttributes())) return false; if (!unknownFields.equals(other.unknownFields)) return false; @@ -423,6 +476,8 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + OWNER_FIELD_NUMBER; hash = (53 * hash) + getOwner().hashCode(); + hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; + hash = (53 * hash) + getOrganization().hashCode(); if (!internalGetAttributes().getMap().isEmpty()) { hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; hash = (53 * hash) + internalGetAttributes().hashCode(); @@ -542,7 +597,7 @@ public static final class Builder extends protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { - case 4: + case 5: return internalGetAttributes(); default: throw new RuntimeException( @@ -553,7 +608,7 @@ protected com.google.protobuf.MapField internalGetMapField( protected com.google.protobuf.MapField internalGetMutableMapField( int number) { switch (number) { - case 4: + case 5: return internalGetMutableAttributes(); default: throw new RuntimeException( @@ -592,6 +647,8 @@ public Builder clear() { owner_ = ""; + organization_ = ""; + internalGetMutableAttributes().clear(); return this; } @@ -623,6 +680,7 @@ public org.wso2.apk.enforcer.discovery.subscription.Application buildPartial() { result.uuid_ = uuid_; result.name_ = name_; result.owner_ = owner_; + result.organization_ = organization_; result.attributes_ = internalGetAttributes(); result.attributes_.makeImmutable(); onBuilt(); @@ -685,6 +743,10 @@ public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.Applicatio owner_ = other.owner_; onChanged(); } + if (!other.getOrganization().isEmpty()) { + organization_ = other.organization_; + onChanged(); + } internalGetMutableAttributes().mergeFrom( other.internalGetAttributes()); this.mergeUnknownFields(other.unknownFields); @@ -945,6 +1007,82 @@ public Builder setOwnerBytes( return this; } + private java.lang.Object organization_ = ""; + /** + * string organization = 4; + * @return The organization. + */ + public java.lang.String getOrganization() { + java.lang.Object ref = organization_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organization_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string organization = 4; + * @return The bytes for organization. + */ + public com.google.protobuf.ByteString + getOrganizationBytes() { + java.lang.Object ref = organization_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + organization_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string organization = 4; + * @param value The organization to set. + * @return This builder for chaining. + */ + public Builder setOrganization( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + organization_ = value; + onChanged(); + return this; + } + /** + * string organization = 4; + * @return This builder for chaining. + */ + public Builder clearOrganization() { + + organization_ = getDefaultInstance().getOrganization(); + onChanged(); + return this; + } + /** + * string organization = 4; + * @param value The bytes for organization to set. + * @return This builder for chaining. + */ + public Builder setOrganizationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + organization_ = value; + onChanged(); + return this; + } + private com.google.protobuf.MapField< java.lang.String, java.lang.String> attributes_; private com.google.protobuf.MapField @@ -972,7 +1110,7 @@ public int getAttributesCount() { return internalGetAttributes().getMap().size(); } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ @java.lang.Override @@ -990,7 +1128,7 @@ public java.util.Map getAttributes() { return getAttributesMap(); } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ @java.lang.Override @@ -998,7 +1136,7 @@ public java.util.Map getAttributesMap() { return internalGetAttributes().getMap(); } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ @java.lang.Override @@ -1011,7 +1149,7 @@ public java.lang.String getAttributesOrDefault( return map.containsKey(key) ? map.get(key) : defaultValue; } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ @java.lang.Override @@ -1032,7 +1170,7 @@ public Builder clearAttributes() { return this; } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ public Builder removeAttributes( @@ -1051,7 +1189,7 @@ public Builder removeAttributes( return internalGetMutableAttributes().getMutableMap(); } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ public Builder putAttributes( java.lang.String key, @@ -1063,7 +1201,7 @@ public Builder putAttributes( return this; } /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ public Builder putAllAttributes( diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingProto.java index 712e3f083..8eb2d71b9 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingProto.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingProto.java @@ -34,11 +34,11 @@ public static void registerAllExtensions( "plicationUUID\030\001 \001(\t\022\026\n\016securityScheme\030\002 " + "\001(\t\022\035\n\025applicationIdentifier\030\003 \001(\t\022\017\n\007ke" + "yType\030\004 \001(\t\022\r\n\005envID\030\005 \001(\t\022\021\n\ttimestamp\030" + - "\006 \001(\003B\235\001\n,org.wso2.apk.enforcer.discover" + + "\006 \001(\003B\227\001\n,org.wso2.apk.enforcer.discover" + "y.subscriptionB\032ApplicationKeyMappingPro" + - "toP\001ZOgithub.com/envoyproxy/go-control-p" + - "lane/wso2/discovery/subscription;subscri" + - "ptionb\006proto3" + "toP\001ZIgithub.com/wso2/apk/adapter/pkg/di" + + "scovery/api/wso2/discovery/subscriptionb" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingProto.java index acf005fed..16a0503f2 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingProto.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingProto.java @@ -32,11 +32,11 @@ public static void registerAllExtensions( "nmapping.proto\022\033wso2.discovery.subscript" + "ion\"S\n\022ApplicationMapping\022\014\n\004uuid\030\001 \001(\t\022" + "\026\n\016applicationRef\030\002 \001(\t\022\027\n\017subscriptionR" + - "ef\030\003 \001(\tB\232\001\n,org.wso2.apk.enforcer.disco" + + "ef\030\003 \001(\tB\224\001\n,org.wso2.apk.enforcer.disco" + "very.subscriptionB\027ApplicationMappingPro" + - "toP\001ZOgithub.com/envoyproxy/go-control-p" + - "lane/wso2/discovery/subscription;subscri" + - "ptionb\006proto3" + "toP\001ZIgithub.com/wso2/apk/adapter/pkg/di" + + "scovery/api/wso2/discovery/subscriptionb" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationOrBuilder.java index df686382a..38bd96619 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationOrBuilder.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationOrBuilder.java @@ -44,11 +44,23 @@ public interface ApplicationOrBuilder extends getOwnerBytes(); /** - * map<string, string> attributes = 4; + * string organization = 4; + * @return The organization. + */ + java.lang.String getOrganization(); + /** + * string organization = 4; + * @return The bytes for organization. + */ + com.google.protobuf.ByteString + getOrganizationBytes(); + + /** + * map<string, string> attributes = 5; */ int getAttributesCount(); /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ boolean containsAttributes( java.lang.String key); @@ -59,19 +71,19 @@ boolean containsAttributes( java.util.Map getAttributes(); /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ java.util.Map getAttributesMap(); /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ java.lang.String getAttributesOrDefault( java.lang.String key, java.lang.String defaultValue); /** - * map<string, string> attributes = 4; + * map<string, string> attributes = 5; */ java.lang.String getAttributesOrThrow( diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationProto.java index d4b5b129c..49d0be32a 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationProto.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationProto.java @@ -24,21 +24,6 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_wso2_discovery_subscription_Application_AttributesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_SecuritySchemes_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_OAuth2_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_OAuth2_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_Environment_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_Environment_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -49,22 +34,16 @@ public static void registerAllExtensions( static { java.lang.String[] descriptorData = { "\n-wso2/discovery/subscription/applicatio" + - "n.proto\022\033wso2.discovery.subscription\"\271\001\n" + + "n.proto\022\033wso2.discovery.subscription\"\317\001\n" + "\013Application\022\014\n\004uuid\030\001 \001(\t\022\014\n\004name\030\002 \001(\t" + - "\022\r\n\005owner\030\003 \001(\t\022L\n\nattributes\030\004 \003(\01328.ws" + - "o2.discovery.subscription.Application.At" + - "tributesEntry\0321\n\017AttributesEntry\022\013\n\003key\030" + - "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"F\n\017SecuritySche" + - "mes\0223\n\006oAuth2\030\001 \001(\0132#.wso2.discovery.sub" + - "scription.OAuth2\"H\n\006OAuth2\022>\n\014environmen" + - "ts\030\001 \003(\0132(.wso2.discovery.subscription.E" + - "nvironment\"L\n\013Environment\022\r\n\005envID\030\001 \001(\t" + - "\022\035\n\025applicationIdentifier\030\002 \001(\t\022\017\n\007keyTy" + - "pe\030\003 \001(\tB\223\001\n,org.wso2.apk.enforcer.disco" + - "very.subscriptionB\020ApplicationProtoP\001ZOg" + - "ithub.com/envoyproxy/go-control-plane/ws" + - "o2/discovery/subscription;subscriptionb\006" + - "proto3" + "\022\r\n\005owner\030\003 \001(\t\022\024\n\014organization\030\004 \001(\t\022L\n" + + "\nattributes\030\005 \003(\01328.wso2.discovery.subsc" + + "ription.Application.AttributesEntry\0321\n\017A" + + "ttributesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001B\215\001\n,org.wso2.apk.enforcer.discove" + + "ry.subscriptionB\020ApplicationProtoP\001ZIgit" + + "hub.com/wso2/apk/adapter/pkg/discovery/a" + + "pi/wso2/discovery/subscriptionb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -75,31 +54,13 @@ public static void registerAllExtensions( internal_static_wso2_discovery_subscription_Application_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_wso2_discovery_subscription_Application_descriptor, - new java.lang.String[] { "Uuid", "Name", "Owner", "Attributes", }); + new java.lang.String[] { "Uuid", "Name", "Owner", "Organization", "Attributes", }); internal_static_wso2_discovery_subscription_Application_AttributesEntry_descriptor = internal_static_wso2_discovery_subscription_Application_descriptor.getNestedTypes().get(0); internal_static_wso2_discovery_subscription_Application_AttributesEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_wso2_discovery_subscription_Application_AttributesEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_wso2_discovery_subscription_SecuritySchemes_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor, - new java.lang.String[] { "OAuth2", }); - internal_static_wso2_discovery_subscription_OAuth2_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_wso2_discovery_subscription_OAuth2_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_OAuth2_descriptor, - new java.lang.String[] { "Environments", }); - internal_static_wso2_discovery_subscription_Environment_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_wso2_discovery_subscription_Environment_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_Environment_descriptor, - new java.lang.String[] { "EnvID", "ApplicationIdentifier", "KeyType", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Event.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Event.java new file mode 100644 index 000000000..5cca96f54 --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Event.java @@ -0,0 +1,1520 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/subscription/event.proto + +package org.wso2.apk.enforcer.discovery.subscription; + +/** + *
+ * Event data model
+ * 
+ * + * Protobuf type {@code wso2.discovery.subscription.Event} + */ +public final class Event extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.Event) + EventOrBuilder { +private static final long serialVersionUID = 0L; + // Use Event.newBuilder() to construct. + private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Event() { + uuid_ = ""; + type_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Event(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Event( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + uuid_ = s; + break; + } + case 16: { + + timeStamp_ = input.readInt64(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 34: { + org.wso2.apk.enforcer.discovery.subscription.Application.Builder subBuilder = null; + if (application_ != null) { + subBuilder = application_.toBuilder(); + } + application_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Application.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(application_); + application_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder subBuilder = null; + if (applicationMapping_ != null) { + subBuilder = applicationMapping_.toBuilder(); + } + applicationMapping_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(applicationMapping_); + applicationMapping_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder subBuilder = null; + if (applicationKeyMapping_ != null) { + subBuilder = applicationKeyMapping_.toBuilder(); + } + applicationKeyMapping_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(applicationKeyMapping_); + applicationKeyMapping_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder subBuilder = null; + if (subscription_ != null) { + subBuilder = subscription_.toBuilder(); + } + subscription_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Subscription.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(subscription_); + subscription_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.enforcer.discovery.subscription.Event.class, org.wso2.apk.enforcer.discovery.subscription.Event.Builder.class); + } + + public static final int UUID_FIELD_NUMBER = 1; + private volatile java.lang.Object uuid_; + /** + * string uuid = 1; + * @return The uuid. + */ + @java.lang.Override + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uuid_ = s; + return s; + } + } + /** + * string uuid = 1; + * @return The bytes for uuid. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timeStamp_; + /** + * int64 timeStamp = 2; + * @return The timeStamp. + */ + @java.lang.Override + public long getTimeStamp() { + return timeStamp_; + } + + public static final int TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object type_; + /** + * string type = 3; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * string type = 3; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLICATION_FIELD_NUMBER = 4; + private org.wso2.apk.enforcer.discovery.subscription.Application application_; + /** + * .wso2.discovery.subscription.Application application = 4; + * @return Whether the application field is set. + */ + @java.lang.Override + public boolean hasApplication() { + return application_ != null; + } + /** + * .wso2.discovery.subscription.Application application = 4; + * @return The application. + */ + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.Application getApplication() { + return application_ == null ? org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance() : application_; + } + /** + * .wso2.discovery.subscription.Application application = 4; + */ + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getApplicationOrBuilder() { + return getApplication(); + } + + public static final int APPLICATIONMAPPING_FIELD_NUMBER = 5; + private org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping_; + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + * @return Whether the applicationMapping field is set. + */ + @java.lang.Override + public boolean hasApplicationMapping() { + return applicationMapping_ != null; + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + * @return The applicationMapping. + */ + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getApplicationMapping() { + return applicationMapping_ == null ? org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance() : applicationMapping_; + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getApplicationMappingOrBuilder() { + return getApplicationMapping(); + } + + public static final int APPLICATIONKEYMAPPING_FIELD_NUMBER = 6; + private org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping_; + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + * @return Whether the applicationKeyMapping field is set. + */ + @java.lang.Override + public boolean hasApplicationKeyMapping() { + return applicationKeyMapping_ != null; + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + * @return The applicationKeyMapping. + */ + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getApplicationKeyMapping() { + return applicationKeyMapping_ == null ? org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance() : applicationKeyMapping_; + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getApplicationKeyMappingOrBuilder() { + return getApplicationKeyMapping(); + } + + public static final int SUBSCRIPTION_FIELD_NUMBER = 7; + private org.wso2.apk.enforcer.discovery.subscription.Subscription subscription_; + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + * @return Whether the subscription field is set. + */ + @java.lang.Override + public boolean hasSubscription() { + return subscription_ != null; + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + * @return The subscription. + */ + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.Subscription getSubscription() { + return subscription_ == null ? org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance() : subscription_; + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getSubscriptionOrBuilder() { + return getSubscription(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUuidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); + } + if (timeStamp_ != 0L) { + output.writeInt64(2, timeStamp_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + if (application_ != null) { + output.writeMessage(4, getApplication()); + } + if (applicationMapping_ != null) { + output.writeMessage(5, getApplicationMapping()); + } + if (applicationKeyMapping_ != null) { + output.writeMessage(6, getApplicationKeyMapping()); + } + if (subscription_ != null) { + output.writeMessage(7, getSubscription()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUuidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); + } + if (timeStamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, timeStamp_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + if (application_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getApplication()); + } + if (applicationMapping_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getApplicationMapping()); + } + if (applicationKeyMapping_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getApplicationKeyMapping()); + } + if (subscription_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getSubscription()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.Event)) { + return super.equals(obj); + } + org.wso2.apk.enforcer.discovery.subscription.Event other = (org.wso2.apk.enforcer.discovery.subscription.Event) obj; + + if (!getUuid() + .equals(other.getUuid())) return false; + if (getTimeStamp() + != other.getTimeStamp()) return false; + if (!getType() + .equals(other.getType())) return false; + if (hasApplication() != other.hasApplication()) return false; + if (hasApplication()) { + if (!getApplication() + .equals(other.getApplication())) return false; + } + if (hasApplicationMapping() != other.hasApplicationMapping()) return false; + if (hasApplicationMapping()) { + if (!getApplicationMapping() + .equals(other.getApplicationMapping())) return false; + } + if (hasApplicationKeyMapping() != other.hasApplicationKeyMapping()) return false; + if (hasApplicationKeyMapping()) { + if (!getApplicationKeyMapping() + .equals(other.getApplicationKeyMapping())) return false; + } + if (hasSubscription() != other.hasSubscription()) return false; + if (hasSubscription()) { + if (!getSubscription() + .equals(other.getSubscription())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UUID_FIELD_NUMBER; + hash = (53 * hash) + getUuid().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimeStamp()); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (hasApplication()) { + hash = (37 * hash) + APPLICATION_FIELD_NUMBER; + hash = (53 * hash) + getApplication().hashCode(); + } + if (hasApplicationMapping()) { + hash = (37 * hash) + APPLICATIONMAPPING_FIELD_NUMBER; + hash = (53 * hash) + getApplicationMapping().hashCode(); + } + if (hasApplicationKeyMapping()) { + hash = (37 * hash) + APPLICATIONKEYMAPPING_FIELD_NUMBER; + hash = (53 * hash) + getApplicationKeyMapping().hashCode(); + } + if (hasSubscription()) { + hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getSubscription().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.wso2.apk.enforcer.discovery.subscription.Event parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.Event prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Event data model
+   * 
+ * + * Protobuf type {@code wso2.discovery.subscription.Event} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.Event) + org.wso2.apk.enforcer.discovery.subscription.EventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.enforcer.discovery.subscription.Event.class, org.wso2.apk.enforcer.discovery.subscription.Event.Builder.class); + } + + // Construct using org.wso2.apk.enforcer.discovery.subscription.Event.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + uuid_ = ""; + + timeStamp_ = 0L; + + type_ = ""; + + if (applicationBuilder_ == null) { + application_ = null; + } else { + application_ = null; + applicationBuilder_ = null; + } + if (applicationMappingBuilder_ == null) { + applicationMapping_ = null; + } else { + applicationMapping_ = null; + applicationMappingBuilder_ = null; + } + if (applicationKeyMappingBuilder_ == null) { + applicationKeyMapping_ = null; + } else { + applicationKeyMapping_ = null; + applicationKeyMappingBuilder_ = null; + } + if (subscriptionBuilder_ == null) { + subscription_ = null; + } else { + subscription_ = null; + subscriptionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.wso2.apk.enforcer.discovery.subscription.EventProto.internal_static_wso2_discovery_subscription_Event_descriptor; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.Event getDefaultInstanceForType() { + return org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance(); + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.Event build() { + org.wso2.apk.enforcer.discovery.subscription.Event result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.Event buildPartial() { + org.wso2.apk.enforcer.discovery.subscription.Event result = new org.wso2.apk.enforcer.discovery.subscription.Event(this); + result.uuid_ = uuid_; + result.timeStamp_ = timeStamp_; + result.type_ = type_; + if (applicationBuilder_ == null) { + result.application_ = application_; + } else { + result.application_ = applicationBuilder_.build(); + } + if (applicationMappingBuilder_ == null) { + result.applicationMapping_ = applicationMapping_; + } else { + result.applicationMapping_ = applicationMappingBuilder_.build(); + } + if (applicationKeyMappingBuilder_ == null) { + result.applicationKeyMapping_ = applicationKeyMapping_; + } else { + result.applicationKeyMapping_ = applicationKeyMappingBuilder_.build(); + } + if (subscriptionBuilder_ == null) { + result.subscription_ = subscription_; + } else { + result.subscription_ = subscriptionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.wso2.apk.enforcer.discovery.subscription.Event) { + return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.Event)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.Event other) { + if (other == org.wso2.apk.enforcer.discovery.subscription.Event.getDefaultInstance()) return this; + if (!other.getUuid().isEmpty()) { + uuid_ = other.uuid_; + onChanged(); + } + if (other.getTimeStamp() != 0L) { + setTimeStamp(other.getTimeStamp()); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (other.hasApplication()) { + mergeApplication(other.getApplication()); + } + if (other.hasApplicationMapping()) { + mergeApplicationMapping(other.getApplicationMapping()); + } + if (other.hasApplicationKeyMapping()) { + mergeApplicationKeyMapping(other.getApplicationKeyMapping()); + } + if (other.hasSubscription()) { + mergeSubscription(other.getSubscription()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.wso2.apk.enforcer.discovery.subscription.Event parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.Event) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uuid_ = ""; + /** + * string uuid = 1; + * @return The uuid. + */ + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uuid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string uuid = 1; + * @return The bytes for uuid. + */ + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string uuid = 1; + * @param value The uuid to set. + * @return This builder for chaining. + */ + public Builder setUuid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uuid_ = value; + onChanged(); + return this; + } + /** + * string uuid = 1; + * @return This builder for chaining. + */ + public Builder clearUuid() { + + uuid_ = getDefaultInstance().getUuid(); + onChanged(); + return this; + } + /** + * string uuid = 1; + * @param value The bytes for uuid to set. + * @return This builder for chaining. + */ + public Builder setUuidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uuid_ = value; + onChanged(); + return this; + } + + private long timeStamp_ ; + /** + * int64 timeStamp = 2; + * @return The timeStamp. + */ + @java.lang.Override + public long getTimeStamp() { + return timeStamp_; + } + /** + * int64 timeStamp = 2; + * @param value The timeStamp to set. + * @return This builder for chaining. + */ + public Builder setTimeStamp(long value) { + + timeStamp_ = value; + onChanged(); + return this; + } + /** + * int64 timeStamp = 2; + * @return This builder for chaining. + */ + public Builder clearTimeStamp() { + + timeStamp_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * string type = 3; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string type = 3; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string type = 3; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * string type = 3; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * string type = 3; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private org.wso2.apk.enforcer.discovery.subscription.Application application_; + private com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder> applicationBuilder_; + /** + * .wso2.discovery.subscription.Application application = 4; + * @return Whether the application field is set. + */ + public boolean hasApplication() { + return applicationBuilder_ != null || application_ != null; + } + /** + * .wso2.discovery.subscription.Application application = 4; + * @return The application. + */ + public org.wso2.apk.enforcer.discovery.subscription.Application getApplication() { + if (applicationBuilder_ == null) { + return application_ == null ? org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance() : application_; + } else { + return applicationBuilder_.getMessage(); + } + } + /** + * .wso2.discovery.subscription.Application application = 4; + */ + public Builder setApplication(org.wso2.apk.enforcer.discovery.subscription.Application value) { + if (applicationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + application_ = value; + onChanged(); + } else { + applicationBuilder_.setMessage(value); + } + + return this; + } + /** + * .wso2.discovery.subscription.Application application = 4; + */ + public Builder setApplication( + org.wso2.apk.enforcer.discovery.subscription.Application.Builder builderForValue) { + if (applicationBuilder_ == null) { + application_ = builderForValue.build(); + onChanged(); + } else { + applicationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .wso2.discovery.subscription.Application application = 4; + */ + public Builder mergeApplication(org.wso2.apk.enforcer.discovery.subscription.Application value) { + if (applicationBuilder_ == null) { + if (application_ != null) { + application_ = + org.wso2.apk.enforcer.discovery.subscription.Application.newBuilder(application_).mergeFrom(value).buildPartial(); + } else { + application_ = value; + } + onChanged(); + } else { + applicationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .wso2.discovery.subscription.Application application = 4; + */ + public Builder clearApplication() { + if (applicationBuilder_ == null) { + application_ = null; + onChanged(); + } else { + application_ = null; + applicationBuilder_ = null; + } + + return this; + } + /** + * .wso2.discovery.subscription.Application application = 4; + */ + public org.wso2.apk.enforcer.discovery.subscription.Application.Builder getApplicationBuilder() { + + onChanged(); + return getApplicationFieldBuilder().getBuilder(); + } + /** + * .wso2.discovery.subscription.Application application = 4; + */ + public org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getApplicationOrBuilder() { + if (applicationBuilder_ != null) { + return applicationBuilder_.getMessageOrBuilder(); + } else { + return application_ == null ? + org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance() : application_; + } + } + /** + * .wso2.discovery.subscription.Application application = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder> + getApplicationFieldBuilder() { + if (applicationBuilder_ == null) { + applicationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder>( + getApplication(), + getParentForChildren(), + isClean()); + application_ = null; + } + return applicationBuilder_; + } + + private org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping_; + private com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder> applicationMappingBuilder_; + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + * @return Whether the applicationMapping field is set. + */ + public boolean hasApplicationMapping() { + return applicationMappingBuilder_ != null || applicationMapping_ != null; + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + * @return The applicationMapping. + */ + public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getApplicationMapping() { + if (applicationMappingBuilder_ == null) { + return applicationMapping_ == null ? org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance() : applicationMapping_; + } else { + return applicationMappingBuilder_.getMessage(); + } + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + public Builder setApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { + if (applicationMappingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + applicationMapping_ = value; + onChanged(); + } else { + applicationMappingBuilder_.setMessage(value); + } + + return this; + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + public Builder setApplicationMapping( + org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder builderForValue) { + if (applicationMappingBuilder_ == null) { + applicationMapping_ = builderForValue.build(); + onChanged(); + } else { + applicationMappingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + public Builder mergeApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { + if (applicationMappingBuilder_ == null) { + if (applicationMapping_ != null) { + applicationMapping_ = + org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.newBuilder(applicationMapping_).mergeFrom(value).buildPartial(); + } else { + applicationMapping_ = value; + } + onChanged(); + } else { + applicationMappingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + public Builder clearApplicationMapping() { + if (applicationMappingBuilder_ == null) { + applicationMapping_ = null; + onChanged(); + } else { + applicationMapping_ = null; + applicationMappingBuilder_ = null; + } + + return this; + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder getApplicationMappingBuilder() { + + onChanged(); + return getApplicationMappingFieldBuilder().getBuilder(); + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getApplicationMappingOrBuilder() { + if (applicationMappingBuilder_ != null) { + return applicationMappingBuilder_.getMessageOrBuilder(); + } else { + return applicationMapping_ == null ? + org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance() : applicationMapping_; + } + } + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder> + getApplicationMappingFieldBuilder() { + if (applicationMappingBuilder_ == null) { + applicationMappingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder>( + getApplicationMapping(), + getParentForChildren(), + isClean()); + applicationMapping_ = null; + } + return applicationMappingBuilder_; + } + + private org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping_; + private com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder> applicationKeyMappingBuilder_; + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + * @return Whether the applicationKeyMapping field is set. + */ + public boolean hasApplicationKeyMapping() { + return applicationKeyMappingBuilder_ != null || applicationKeyMapping_ != null; + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + * @return The applicationKeyMapping. + */ + public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getApplicationKeyMapping() { + if (applicationKeyMappingBuilder_ == null) { + return applicationKeyMapping_ == null ? org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance() : applicationKeyMapping_; + } else { + return applicationKeyMappingBuilder_.getMessage(); + } + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + public Builder setApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { + if (applicationKeyMappingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + applicationKeyMapping_ = value; + onChanged(); + } else { + applicationKeyMappingBuilder_.setMessage(value); + } + + return this; + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + public Builder setApplicationKeyMapping( + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder builderForValue) { + if (applicationKeyMappingBuilder_ == null) { + applicationKeyMapping_ = builderForValue.build(); + onChanged(); + } else { + applicationKeyMappingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + public Builder mergeApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { + if (applicationKeyMappingBuilder_ == null) { + if (applicationKeyMapping_ != null) { + applicationKeyMapping_ = + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.newBuilder(applicationKeyMapping_).mergeFrom(value).buildPartial(); + } else { + applicationKeyMapping_ = value; + } + onChanged(); + } else { + applicationKeyMappingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + public Builder clearApplicationKeyMapping() { + if (applicationKeyMappingBuilder_ == null) { + applicationKeyMapping_ = null; + onChanged(); + } else { + applicationKeyMapping_ = null; + applicationKeyMappingBuilder_ = null; + } + + return this; + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder getApplicationKeyMappingBuilder() { + + onChanged(); + return getApplicationKeyMappingFieldBuilder().getBuilder(); + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getApplicationKeyMappingOrBuilder() { + if (applicationKeyMappingBuilder_ != null) { + return applicationKeyMappingBuilder_.getMessageOrBuilder(); + } else { + return applicationKeyMapping_ == null ? + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance() : applicationKeyMapping_; + } + } + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder> + getApplicationKeyMappingFieldBuilder() { + if (applicationKeyMappingBuilder_ == null) { + applicationKeyMappingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder>( + getApplicationKeyMapping(), + getParentForChildren(), + isClean()); + applicationKeyMapping_ = null; + } + return applicationKeyMappingBuilder_; + } + + private org.wso2.apk.enforcer.discovery.subscription.Subscription subscription_; + private com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder> subscriptionBuilder_; + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + * @return Whether the subscription field is set. + */ + public boolean hasSubscription() { + return subscriptionBuilder_ != null || subscription_ != null; + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + * @return The subscription. + */ + public org.wso2.apk.enforcer.discovery.subscription.Subscription getSubscription() { + if (subscriptionBuilder_ == null) { + return subscription_ == null ? org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance() : subscription_; + } else { + return subscriptionBuilder_.getMessage(); + } + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + public Builder setSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription value) { + if (subscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subscription_ = value; + onChanged(); + } else { + subscriptionBuilder_.setMessage(value); + } + + return this; + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + public Builder setSubscription( + org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder builderForValue) { + if (subscriptionBuilder_ == null) { + subscription_ = builderForValue.build(); + onChanged(); + } else { + subscriptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + public Builder mergeSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription value) { + if (subscriptionBuilder_ == null) { + if (subscription_ != null) { + subscription_ = + org.wso2.apk.enforcer.discovery.subscription.Subscription.newBuilder(subscription_).mergeFrom(value).buildPartial(); + } else { + subscription_ = value; + } + onChanged(); + } else { + subscriptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + public Builder clearSubscription() { + if (subscriptionBuilder_ == null) { + subscription_ = null; + onChanged(); + } else { + subscription_ = null; + subscriptionBuilder_ = null; + } + + return this; + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + public org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder getSubscriptionBuilder() { + + onChanged(); + return getSubscriptionFieldBuilder().getBuilder(); + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + public org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getSubscriptionOrBuilder() { + if (subscriptionBuilder_ != null) { + return subscriptionBuilder_.getMessageOrBuilder(); + } else { + return subscription_ == null ? + org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance() : subscription_; + } + } + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder> + getSubscriptionFieldBuilder() { + if (subscriptionBuilder_ == null) { + subscriptionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder>( + getSubscription(), + getParentForChildren(), + isClean()); + subscription_ = null; + } + return subscriptionBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.Event) + } + + // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.Event) + private static final org.wso2.apk.enforcer.discovery.subscription.Event DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.Event(); + } + + public static org.wso2.apk.enforcer.discovery.subscription.Event getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Event parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Event(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public org.wso2.apk.enforcer.discovery.subscription.Event getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventOrBuilder.java new file mode 100644 index 000000000..8f693067f --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/subscription/event.proto + +package org.wso2.apk.enforcer.discovery.subscription; + +public interface EventOrBuilder extends + // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.Event) + com.google.protobuf.MessageOrBuilder { + + /** + * string uuid = 1; + * @return The uuid. + */ + java.lang.String getUuid(); + /** + * string uuid = 1; + * @return The bytes for uuid. + */ + com.google.protobuf.ByteString + getUuidBytes(); + + /** + * int64 timeStamp = 2; + * @return The timeStamp. + */ + long getTimeStamp(); + + /** + * string type = 3; + * @return The type. + */ + java.lang.String getType(); + /** + * string type = 3; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + * .wso2.discovery.subscription.Application application = 4; + * @return Whether the application field is set. + */ + boolean hasApplication(); + /** + * .wso2.discovery.subscription.Application application = 4; + * @return The application. + */ + org.wso2.apk.enforcer.discovery.subscription.Application getApplication(); + /** + * .wso2.discovery.subscription.Application application = 4; + */ + org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getApplicationOrBuilder(); + + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + * @return Whether the applicationMapping field is set. + */ + boolean hasApplicationMapping(); + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + * @return The applicationMapping. + */ + org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getApplicationMapping(); + /** + * .wso2.discovery.subscription.ApplicationMapping applicationMapping = 5; + */ + org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getApplicationMappingOrBuilder(); + + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + * @return Whether the applicationKeyMapping field is set. + */ + boolean hasApplicationKeyMapping(); + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + * @return The applicationKeyMapping. + */ + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getApplicationKeyMapping(); + /** + * .wso2.discovery.subscription.ApplicationKeyMapping applicationKeyMapping = 6; + */ + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getApplicationKeyMappingOrBuilder(); + + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + * @return Whether the subscription field is set. + */ + boolean hasSubscription(); + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + * @return The subscription. + */ + org.wso2.apk.enforcer.discovery.subscription.Subscription getSubscription(); + /** + * .wso2.discovery.subscription.Subscription subscription = 7; + */ + org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getSubscriptionOrBuilder(); +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventProto.java new file mode 100644 index 000000000..7c794cb2e --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventProto.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: wso2/discovery/subscription/event.proto + +package org.wso2.apk.enforcer.discovery.subscription; + +public final class EventProto { + private EventProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_wso2_discovery_subscription_Event_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_wso2_discovery_subscription_Event_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\'wso2/discovery/subscription/event.prot" + + "o\022\033wso2.discovery.subscription\032-wso2/dis" + + "covery/subscription/application.proto\0324w" + + "so2/discovery/subscription/applicationma" + + "pping.proto\0329wso2/discovery/subscription" + + "/application_key_mapping.proto\032.wso2/dis" + + "covery/subscription/subscription.proto\"\326" + + "\002\n\005Event\022\014\n\004uuid\030\001 \001(\t\022\021\n\ttimeStamp\030\002 \001(" + + "\003\022\014\n\004type\030\003 \001(\t\022=\n\013application\030\004 \001(\0132(.w" + + "so2.discovery.subscription.Application\022K" + + "\n\022applicationMapping\030\005 \001(\0132/.wso2.discov" + + "ery.subscription.ApplicationMapping\022Q\n\025a" + + "pplicationKeyMapping\030\006 \001(\01322.wso2.discov" + + "ery.subscription.ApplicationKeyMapping\022?" + + "\n\014subscription\030\007 \001(\0132).wso2.discovery.su" + + "bscription.SubscriptionB\207\001\n,org.wso2.apk" + + ".enforcer.discovery.subscriptionB\nEventP" + + "rotoP\001ZIgithub.com/wso2/apk/adapter/pkg/" + + "discovery/api/wso2/discovery/subscriptio" + + "nb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.getDescriptor(), + org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.getDescriptor(), + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.getDescriptor(), + org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.getDescriptor(), + }); + internal_static_wso2_discovery_subscription_Event_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_wso2_discovery_subscription_Event_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_wso2_discovery_subscription_Event_descriptor, + new java.lang.String[] { "Uuid", "TimeStamp", "Type", "Application", "ApplicationMapping", "ApplicationKeyMapping", "Subscription", }); + org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.getDescriptor(); + org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.getDescriptor(); + org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.getDescriptor(); + org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionProto.java index 5bd30b302..d8fe93be3 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionProto.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionProto.java @@ -39,11 +39,11 @@ public static void registerAllExtensions( "d\030\002 \001(\t\022\024\n\014organization\030\003 \001(\t\022A\n\rsubscri" + "bedApi\030\004 \001(\0132*.wso2.discovery.subscripti" + "on.SubscribedAPI\".\n\rSubscribedAPI\022\014\n\004nam" + - "e\030\001 \001(\t\022\017\n\007version\030\002 \001(\tB\224\001\n,org.wso2.ap" + + "e\030\001 \001(\t\022\017\n\007version\030\002 \001(\tB\216\001\n,org.wso2.ap" + "k.enforcer.discovery.subscriptionB\021Subsc" + - "riptionProtoP\001ZOgithub.com/envoyproxy/go" + - "-control-plane/wso2/discovery/subscripti" + - "on;subscriptionb\006proto3" + "riptionProtoP\001ZIgithub.com/wso2/apk/adap" + + "ter/pkg/discovery/api/wso2/discovery/sub" + + "scriptionb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 7c52d2566..41fd0df10 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -245,8 +245,8 @@ wso2: failureThreshold: 5 strategy: RollingUpdate replicas: 1 - imagePullPolicy: Always - image: wso2/apk-common-controller:latest + imagePullPolicy: IfNotPresent + image: apk-common-controller:1.0.0-SNAPSHOT security: sslHostname: "commoncontroller" # configs: @@ -333,8 +333,8 @@ wso2: periodSeconds: 20 failureThreshold: 5 strategy: RollingUpdate - imagePullPolicy: Always - image: wso2/apk-enforcer:latest + imagePullPolicy: IfNotPresent + image: apk-enforcer:1.0.0-SNAPSHOT security: sslHostname: "enforcer" # logging: From 0afc3862111e54a2b012008da02f6ceccd308c13 Mon Sep 17 00:00:00 2001 From: tharindu1st Date: Wed, 15 Nov 2023 09:02:37 +0530 Subject: [PATCH 4/4] remove unused code --- adapter/internal/adapter/adapter.go | 5 - adapter/internal/discovery/xds/marshaller.go | 181 --- adapter/internal/discovery/xds/server.go | 125 +- .../discovery/protocol/server/v3/server.go | 55 - common-controller/go.mod | 2 +- .../internal/cache/subscriptionDataStore.go | 6 +- .../internal/operator/constant/constant.go | 26 +- .../controllers/cp/application_controller.go | 28 +- .../cp/applicationmapping_controller.go | 14 +- .../controllers/cp/subscription_controller.go | 6 +- .../internal/server/event_server.go | 5 +- .../internal/utils/event_utils.go | 72 +- .../apk/enforcer/config/ConfigHolder.java | 17 +- .../RevokedTokenDiscoveryClient.java | 223 --- .../scheduler/XdsSchedulerManager.java | 35 +- .../discovery/subscription/APIOrBuilder.java | 46 - .../ApplicationKeyMappingList.java | 778 --------- .../ApplicationKeyMappingListOrBuilder.java | 33 - .../ApplicationKeyMappingListProto.java | 58 - .../subscription/ApplicationList.java | 778 --------- .../ApplicationListOrBuilder.java | 33 - .../subscription/ApplicationListProto.java | 57 - .../subscription/ApplicationMappingList.java | 778 --------- .../ApplicationMappingListOrBuilder.java | 33 - .../ApplicationMappingListProto.java | 57 - .../subscription/ApplicationPolicy.java | 831 ---------- .../subscription/ApplicationPolicyList.java | 778 --------- .../ApplicationPolicyListOrBuilder.java | 33 - .../ApplicationPolicyListProto.java | 57 - .../ApplicationPolicyOrBuilder.java | 45 - .../subscription/ApplicationPolicyProto.java | 54 - .../AuthenticationOptionOrBuilder.java | 57 - .../discovery/subscription/Environment.java | 833 ---------- .../subscription/EnvironmentOrBuilder.java | 45 - .../discovery/subscription/OAuth2.java | 770 --------- .../subscription/OAuth2OrBuilder.java | 33 - .../subscription/SecuritySchemes.java | 607 ------- .../SecuritySchemesOrBuilder.java | 24 - .../subscription/SubscriptionList.java | 778 --------- .../SubscriptionListOrBuilder.java | 33 - .../subscription/SubscriptionListProto.java | 57 - .../subscription/SubscriptionPolicy.java | 1429 ----------------- .../subscription/SubscriptionPolicyList.java | 778 --------- .../SubscriptionPolicyListOrBuilder.java | 33 - .../SubscriptionPolicyListProto.java | 58 - .../SubscriptionPolicyOrBuilder.java | 99 -- .../subscription/SubscriptionPolicyProto.java | 58 - .../wso2/apk/enforcer/models/Application.java | 28 + .../apk/enforcer/models/SubscribedAPI.java | 9 + .../jwt/validator/RevokedJWTDataHolder.java | 3 - .../subscription/EventingGrpcClient.java | 172 ++ .../subscription/SubscriptionDataStore.java | 23 +- .../SubscriptionDataStoreImpl.java | 138 +- .../org/wso2/apk/enforcer/util/GRPCUtils.java | 6 + .../org/wso2/apk/enforcer/util/TLSUtils.java | 28 + .../gateway-runtime-deployment.yaml | 3 +- helm-charts/values.yaml | 4 +- 57 files changed, 532 insertions(+), 10823 deletions(-) delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/RevokedTokenDiscoveryClient.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/APIOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicy.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/AuthenticationOptionOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Environment.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EnvironmentOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2OrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemes.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemesOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicy.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyProto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java diff --git a/adapter/internal/adapter/adapter.go b/adapter/internal/adapter/adapter.go index 56621e1d8..7330f0835 100644 --- a/adapter/internal/adapter/adapter.go +++ b/adapter/internal/adapter/adapter.go @@ -29,7 +29,6 @@ import ( "github.com/wso2/apk/adapter/internal/operator" apiservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/api" configservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/config" - keymanagerservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/keymgt" subscriptionservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/subscription" wso2_server "github.com/wso2/apk/adapter/pkg/discovery/protocol/server/v3" "github.com/wso2/apk/adapter/pkg/health" @@ -120,10 +119,6 @@ func runManagementServer(conf *config.Config, server xdsv3.Server, enforcerServe configservice.RegisterConfigDiscoveryServiceServer(grpcServer, enforcerServer) apiservice.RegisterApiDiscoveryServiceServer(grpcServer, enforcerServer) subscriptionservice.RegisterApiListDiscoveryServiceServer(grpcServer, enforcerAPIDsSrv) - subscriptionservice.RegisterApplicationPolicyDiscoveryServiceServer(grpcServer, enforcerAppPolicyDsSrv) - subscriptionservice.RegisterSubscriptionPolicyDiscoveryServiceServer(grpcServer, enforcerSubPolicyDsSrv) - keymanagerservice.RegisterKMDiscoveryServiceServer(grpcServer, enforcerKeyManagerDsSrv) - keymanagerservice.RegisterRevokedTokenDiscoveryServiceServer(grpcServer, enforcerRevokedTokenDsSrv) subscriptionservice.RegisterJWTIssuerDiscoveryServiceServer(grpcServer, enforcerJwtIssuerDsSrv) // register health service healthservice.RegisterHealthServer(grpcServer, &health.Server{}) diff --git a/adapter/internal/discovery/xds/marshaller.go b/adapter/internal/discovery/xds/marshaller.go index e60192fd8..9abff744f 100644 --- a/adapter/internal/discovery/xds/marshaller.go +++ b/adapter/internal/discovery/xds/marshaller.go @@ -18,14 +18,11 @@ package xds import ( - "encoding/json" - "fmt" "strconv" "github.com/wso2/apk/adapter/config" logger "github.com/wso2/apk/adapter/internal/loggers" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/config/enforcer" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/keymgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" "github.com/wso2/apk/adapter/pkg/eventhub/types" ) @@ -33,16 +30,6 @@ import ( var ( // APIListMap has the following mapping label -> apiUUID -> API (Metadata) APIListMap map[string]map[string]*subscription.APIs - // SubscriptionMap contains the subscriptions recieved from API Manager Control Plane - SubscriptionMap map[int32]*subscription.Subscription - // ApplicationMap contains the applications recieved from API Manager Control Plane - ApplicationMap map[string]*subscription.Application - // ApplicationKeyMappingMap contains the application key mappings recieved from API Manager Control Plane - ApplicationKeyMappingMap map[string]*subscription.ApplicationKeyMapping - // ApplicationPolicyMap contains the application policies recieved from API Manager Control Plane - ApplicationPolicyMap map[int32]*subscription.ApplicationPolicy - // SubscriptionPolicyMap contains the subscription policies recieved from API Manager Control Plane - SubscriptionPolicyMap map[int32]*subscription.SubscriptionPolicy ) // EventType is a enum to distinguish Create, Update and Delete Events @@ -186,30 +173,6 @@ func marshalAnalyticsPublishers(config config.Config) []*enforcer.AnalyticsPubli return resolvedAnalyticsPublishers } -// marshalSubscriptionMapToList converts the data into SubscriptionList proto type -func marshalSubscriptionMapToList(subscriptionMap map[int32]*subscription.Subscription) *subscription.SubscriptionList { - subscriptions := []*subscription.Subscription{} - for _, sub := range subscriptionMap { - subscriptions = append(subscriptions, sub) - } - - return &subscription.SubscriptionList{ - List: subscriptions, - } -} - -// marshalApplicationMapToList converts the data into ApplicationList proto type -func marshalApplicationMapToList(appMap map[string]*subscription.Application) *subscription.ApplicationList { - applications := []*subscription.Application{} - for _, app := range appMap { - applications = append(applications, app) - } - - return &subscription.ApplicationList{ - List: applications, - } -} - // marshalAPIListMapToList converts the data into APIList proto type func marshalAPIListMapToList(apiMap map[string]*subscription.APIs) *subscription.APIList { apis := []*subscription.APIs{} @@ -222,125 +185,6 @@ func marshalAPIListMapToList(apiMap map[string]*subscription.APIs) *subscription } } -// marshalApplicationPolicyMapToList converts the data into ApplicationPolicyList proto type -func marshalApplicationPolicyMapToList(appPolicyMap map[int32]*subscription.ApplicationPolicy) *subscription.ApplicationPolicyList { - applicationPolicies := []*subscription.ApplicationPolicy{} - for _, policy := range appPolicyMap { - applicationPolicies = append(applicationPolicies, policy) - } - - return &subscription.ApplicationPolicyList{ - List: applicationPolicies, - } -} - -// marshalSubscriptionPolicyMapToList converts the data into SubscriptionPolicyList proto type -func marshalSubscriptionPolicyMapToList(subPolicyMap map[int32]*subscription.SubscriptionPolicy) *subscription.SubscriptionPolicyList { - subscriptionPolicies := []*subscription.SubscriptionPolicy{} - - for _, policy := range subPolicyMap { - subscriptionPolicies = append(subscriptionPolicies, policy) - } - - return &subscription.SubscriptionPolicyList{ - List: subscriptionPolicies, - } -} - -// marshalKeyMappingMapToList converts the data into ApplicationKeyMappingList proto type -func marshalKeyMappingMapToList(keyMappingMap map[string]*subscription.ApplicationKeyMapping) *subscription.ApplicationKeyMappingList { - applicationKeyMappings := []*subscription.ApplicationKeyMapping{} - - for _, keyMapping := range keyMappingMap { - // TODO: (VirajSalaka) tenant domain check missing - applicationKeyMappings = append(applicationKeyMappings, keyMapping) - } - - return &subscription.ApplicationKeyMappingList{ - List: applicationKeyMappings, - } -} - -// MarshalKeyManager converts the data into KeyManager proto type -func MarshalKeyManager(keyManager *types.KeyManager) *keymgt.KeyManagerConfig { - configList, err := json.Marshal(keyManager.Configuration) - configuration := string(configList) - if err == nil { - newKeyManager := &keymgt.KeyManagerConfig{ - Name: keyManager.Name, - Type: keyManager.Type, - Enabled: keyManager.Enabled, - TenantDomain: keyManager.TenantDomain, - Configuration: configuration, - } - return newKeyManager - } - logger.LoggerXds.Debugf("Error happens while marshaling key manager data for " + fmt.Sprint(keyManager.Name)) - return nil -} - -// MarshalMultipleApplicationPolicies is used to update the applicationPolicies during the startup where -// multiple application policies are pulled at once. And then it returns the ApplicationPolicyList. -func MarshalMultipleApplicationPolicies(policies *types.ApplicationPolicyList) *subscription.ApplicationPolicyList { - resourceMap := make(map[int32]*subscription.ApplicationPolicy) - for item := range policies.List { - policy := policies.List[item] - appPolicy := marshalApplicationPolicy(&policy) - resourceMap[policy.ID] = appPolicy - logger.LoggerXds.Infof("appPolicy Entry is added : %v", appPolicy) - } - ApplicationPolicyMap = resourceMap - return marshalApplicationPolicyMapToList(ApplicationPolicyMap) -} - -// MarshalApplicationPolicyEventAndReturnList handles the Application Policy Event corresponding to the event received -// from message broker. And then it returns the ApplicationPolicyList. -func MarshalApplicationPolicyEventAndReturnList(policy *types.ApplicationPolicy, eventType EventType) *subscription.ApplicationPolicyList { - if eventType == DeleteEvent { - delete(ApplicationPolicyMap, policy.ID) - logger.LoggerXds.Infof("Application Policy: %s is deleted.", policy.Name) - } else { - appPolicy := marshalApplicationPolicy(policy) - ApplicationPolicyMap[policy.ID] = appPolicy - if eventType == UpdateEvent { - logger.LoggerSvcDiscovery.Infof("Application Policy: %s is updated.", appPolicy.Name) - } else { - logger.LoggerSvcDiscovery.Infof("Application Policy: %s is added.", appPolicy.Name) - } - } - return marshalApplicationPolicyMapToList(ApplicationPolicyMap) -} - -// MarshalMultipleSubscriptionPolicies is used to update the subscriptionPolicies during the startup where -// multiple subscription policies are pulled at once. And then it returns the SubscriptionPolicyList. -func MarshalMultipleSubscriptionPolicies(policies *types.SubscriptionPolicyList) *subscription.SubscriptionPolicyList { - resourceMap := make(map[int32]*subscription.SubscriptionPolicy) - for item := range policies.List { - policy := policies.List[item] - resourceMap[policy.ID] = marshalSubscriptionPolicy(&policy) - } - SubscriptionPolicyMap = resourceMap - return marshalSubscriptionPolicyMapToList(SubscriptionPolicyMap) -} - -// MarshalSubscriptionPolicyEventAndReturnList handles the Subscription Policy Event corresponding to the event received -// from message broker. And then it returns the subscriptionPolicyList. -func MarshalSubscriptionPolicyEventAndReturnList(policy *types.SubscriptionPolicy, eventType EventType) *subscription.SubscriptionPolicyList { - if eventType == DeleteEvent { - delete(ApplicationPolicyMap, policy.ID) - logger.LoggerXds.Infof("Application Policy: %s is deleted.", policy.Name) - } else { - subPolicy := marshalSubscriptionPolicy(policy) - SubscriptionPolicyMap[policy.ID] = subPolicy - if eventType == UpdateEvent { - logger.LoggerSvcDiscovery.Infof("Subscription Policy: %s is updated.", subPolicy.Name) - } else { - logger.LoggerSvcDiscovery.Infof("Subscription Policy: %s is added.", subPolicy.Name) - } - } - return marshalSubscriptionPolicyMapToList(SubscriptionPolicyMap) -} - // MarshalAPIMetataAndReturnList updates the internal APIListMap and returns the XDS compatible APIList. // apiList is the internal APIList object (For single API, this would contain a List with just one API) // initialAPIUUIDListMap is assigned during startup when global adapter is associated. This would be empty otherwise. @@ -420,31 +264,6 @@ func marshalAPIMetadata(api *types.API) *subscription.APIs { } } -func marshalApplicationPolicy(policy *types.ApplicationPolicy) *subscription.ApplicationPolicy { - return &subscription.ApplicationPolicy{ - Id: policy.ID, - TenantId: policy.TenantID, - Name: policy.Name, - QuotaType: policy.QuotaType, - } -} - -func marshalSubscriptionPolicy(policy *types.SubscriptionPolicy) *subscription.SubscriptionPolicy { - return &subscription.SubscriptionPolicy{ - Id: policy.ID, - Name: policy.Name, - QuotaType: policy.QuotaType, - GraphQLMaxComplexity: policy.GraphQLMaxComplexity, - GraphQLMaxDepth: policy.GraphQLMaxDepth, - RateLimitCount: policy.RateLimitCount, - RateLimitTimeUnit: policy.RateLimitTimeUnit, - StopOnQuotaReach: policy.StopOnQuotaReach, - TenantId: policy.TenantID, - TenantDomain: policy.TenantDomain, - Timestamp: policy.TimeStamp, - } -} - // CheckIfAPIMetadataIsAlreadyAvailable returns true only if the API Metadata for the given API UUID // is already available func CheckIfAPIMetadataIsAlreadyAvailable(apiUUID, label string) bool { diff --git a/adapter/internal/discovery/xds/server.go b/adapter/internal/discovery/xds/server.go index faa0e09be..0cc2d476f 100644 --- a/adapter/internal/discovery/xds/server.go +++ b/adapter/internal/discovery/xds/server.go @@ -77,13 +77,9 @@ type EnvoyGatewayConfig struct { // EnforcerInternalAPI struct use to hold enforcer resources type EnforcerInternalAPI struct { - configs []types.Resource - keyManagers []types.Resource - apiList []types.Resource - applicationPolicies []types.Resource - subscriptionPolicies []types.Resource - revokedTokens []types.Resource - jwtIssuers []types.Resource + configs []types.Resource + apiList []types.Resource + jwtIssuers []types.Resource } var ( @@ -91,15 +87,15 @@ var ( mutexForXdsUpdate sync.Mutex mutexForInternalMapUpdate sync.Mutex - cache envoy_cachev3.SnapshotCache - enforcerCache wso2_cache.SnapshotCache - enforcerJwtIssuerCache wso2_cache.SnapshotCache - enforcerAPICache wso2_cache.SnapshotCache - enforcerApplicationPolicyCache wso2_cache.SnapshotCache - enforcerSubscriptionPolicyCache wso2_cache.SnapshotCache - enforcerKeyManagerCache wso2_cache.SnapshotCache - enforcerRevokedTokensCache wso2_cache.SnapshotCache - enforcerThrottleDataCache wso2_cache.SnapshotCache + cache envoy_cachev3.SnapshotCache + enforcerCache wso2_cache.SnapshotCache + enforcerJwtIssuerCache wso2_cache.SnapshotCache + enforcerAPICache wso2_cache.SnapshotCache + enforcerApplicationPolicyCache wso2_cache.SnapshotCache + enforcerSubscriptionPolicyCache wso2_cache.SnapshotCache + enforcerKeyManagerCache wso2_cache.SnapshotCache + enforcerRevokedTokensCache wso2_cache.SnapshotCache + enforcerThrottleDataCache wso2_cache.SnapshotCache orgAPIMap map[string]map[string]*EnvoyInternalAPI // organizationID -> Vhost:API_UUID -> EnvoyInternalAPI struct map @@ -121,8 +117,6 @@ var ( isReady = false ) -var void struct{} - const ( commonEnforcerLabel string = "commonEnforcerLabel" maxRandomInt int = 999999999 @@ -596,46 +590,6 @@ func UpdateEnforcerAPIList(label string, apis *subscription.APIList) { logger.LoggerXds.Infof("New API List cache update for the label: " + label + " version: " + fmt.Sprint(version)) } -// UpdateEnforcerApplicationPolicies sets new update to the enforcer's Application Policies -func UpdateEnforcerApplicationPolicies(applicationPolicies *subscription.ApplicationPolicyList) { - logger.LoggerXds.Debug("Updating Enforcer Application Policy Cache") - label := commonEnforcerLabel - applicationPolicyList := append(enforcerLabelMap[label].applicationPolicies, applicationPolicies) - - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.ApplicationPolicyListType: applicationPolicyList, - }) - snap.Consistent() - - errSetSnap := enforcerApplicationPolicyCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].subscriptionPolicies = applicationPolicyList - logger.LoggerXds.Infof("New Application Policy cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - -// UpdateEnforcerSubscriptionPolicies sets new update to the enforcer's Subscription Policies -func UpdateEnforcerSubscriptionPolicies(subscriptionPolicies *subscription.SubscriptionPolicyList) { - logger.LoggerXds.Debug("Updating Enforcer Subscription Policy Cache") - label := commonEnforcerLabel - subscriptionPolicyList := append(enforcerLabelMap[label].subscriptionPolicies, subscriptionPolicies) - - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.SubscriptionPolicyListType: subscriptionPolicyList, - }) - snap.Consistent() - - errSetSnap := enforcerSubscriptionPolicyCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].subscriptionPolicies = subscriptionPolicyList - logger.LoggerXds.Infof("New Subscription Policy cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - // UpdateXdsCacheWithLock uses mutex and lock to avoid different go routines updating XDS at the same time func UpdateXdsCacheWithLock(label string, endpoints []types.Resource, clusters []types.Resource, routes []types.Resource, listeners []types.Resource) bool { @@ -690,59 +644,6 @@ func ExtractUUIDFromAPIIdentifier(id string) (string, error) { return "", err } -// GenerateAndUpdateKeyManagerList converts the data into KeyManager proto type -func GenerateAndUpdateKeyManagerList() { - var keyManagerConfigList = make([]types.Resource, 0) - for item := range KeyManagerList { - keyManager := KeyManagerList[item] - kmConfig := MarshalKeyManager(&keyManager) - if kmConfig != nil { - keyManagerConfigList = append(keyManagerConfigList, kmConfig) - } - } - UpdateEnforcerKeyManagers(keyManagerConfigList) -} - -// UpdateEnforcerKeyManagers Sets new update to the enforcer's configuration -func UpdateEnforcerKeyManagers(keyManagerConfigList []types.Resource) { - logger.LoggerXds.Debug("Updating Key Manager Cache") - label := commonEnforcerLabel - - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.KeyManagerType: keyManagerConfigList, - }) - snap.Consistent() - - errSetSnap := enforcerKeyManagerCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].keyManagers = keyManagerConfigList - logger.LoggerXds.Infof("New key manager cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - -// UpdateEnforcerRevokedTokens method update the revoked tokens -// in the enforcer -func UpdateEnforcerRevokedTokens(revokedTokens []types.Resource) { - logger.LoggerXds.Debug("Updating enforcer cache for revoked tokens") - label := commonEnforcerLabel - tokens := append(enforcerLabelMap[label].revokedTokens, revokedTokens...) - - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.RevokedTokensType: revokedTokens, - }) - snap.Consistent() - - errSetSnap := enforcerRevokedTokensCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].revokedTokens = tokens - logger.LoggerXds.Infof("New Revoked token cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - // RemoveAPICacheForEnv will remove all the internal mappings for a specific environment func RemoveAPICacheForEnv(adapterInternalAPI model.AdapterInternalAPI, envType string) { vHostIdentifier := GetvHostsIdentifier(adapterInternalAPI.UUID, envType) @@ -757,7 +658,7 @@ func RemoveAPICacheForEnv(adapterInternalAPI model.AdapterInternalAPI, envType s } } } - } + } } // RemoveAPIFromOrgAPIMap removes api from orgAPI map diff --git a/adapter/pkg/discovery/protocol/server/v3/server.go b/adapter/pkg/discovery/protocol/server/v3/server.go index 23877b7b6..1332178d9 100644 --- a/adapter/pkg/discovery/protocol/server/v3/server.go +++ b/adapter/pkg/discovery/protocol/server/v3/server.go @@ -25,9 +25,7 @@ import ( streamv3 "github.com/envoyproxy/go-control-plane/pkg/server/stream/v3" xdsv3 "github.com/envoyproxy/go-control-plane/pkg/server/v3" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/api" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/config" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/keymgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/subscription" "github.com/wso2/apk/adapter/pkg/discovery/protocol/resource/v3" "github.com/wso2/apk/adapter/pkg/discovery/protocol/server/sotw/v3" @@ -39,18 +37,8 @@ import ( type Server interface { config.ConfigDiscoveryServiceServer api.ApiDiscoveryServiceServer - subscription.SubscriptionDiscoveryServiceServer - subscription.ApplicationDiscoveryServiceServer subscription.ApiListDiscoveryServiceServer - subscription.ApplicationPolicyDiscoveryServiceServer subscription.JWTIssuerDiscoveryServiceServer - subscription.SubscriptionPolicyDiscoveryServiceServer - subscription.ApplicationKeyMappingDiscoveryServiceServer - subscription.ApplicationMappingDiscoveryServiceServer - keymgt.KMDiscoveryServiceServer - keymgt.RevokedTokenDiscoveryServiceServer - apkmgt.APKMgtDiscoveryServiceServer - rest.Server envoy_sotw.Server envoy_delta.Server @@ -70,17 +58,8 @@ func NewServerAdvanced(restServer rest.Server, sotwServer envoy_sotw.Server, del type server struct { config.UnimplementedConfigDiscoveryServiceServer api.UnimplementedApiDiscoveryServiceServer - subscription.UnimplementedSubscriptionDiscoveryServiceServer - subscription.UnimplementedApplicationDiscoveryServiceServer subscription.UnimplementedJWTIssuerDiscoveryServiceServer subscription.UnimplementedApiListDiscoveryServiceServer - subscription.UnimplementedApplicationPolicyDiscoveryServiceServer - subscription.UnimplementedSubscriptionPolicyDiscoveryServiceServer - subscription.UnimplementedApplicationKeyMappingDiscoveryServiceServer - subscription.UnimplementedApplicationMappingDiscoveryServiceServer - keymgt.UnimplementedKMDiscoveryServiceServer - keymgt.UnimplementedRevokedTokenDiscoveryServiceServer - apkmgt.UnimplementedAPKMgtDiscoveryServiceServer rest rest.Server sotw envoy_sotw.Server delta envoy_delta.Server @@ -98,45 +77,11 @@ func (s *server) StreamApis(stream api.ApiDiscoveryService_StreamApisServer) err return s.StreamHandler(stream, resource.APIType) } -func (s *server) StreamSubscriptions(stream subscription.SubscriptionDiscoveryService_StreamSubscriptionsServer) error { - return s.StreamHandler(stream, resource.SubscriptionListType) -} func (s *server) StreamApiList(stream subscription.ApiListDiscoveryService_StreamApiListServer) error { return s.StreamHandler(stream, resource.APIListType) } -func (s *server) StreamApplications(stream subscription.ApplicationDiscoveryService_StreamApplicationsServer) error { - return s.StreamHandler(stream, resource.ApplicationListType) -} - -func (s *server) StreamApplicationPolicies(stream subscription.ApplicationPolicyDiscoveryService_StreamApplicationPoliciesServer) error { - return s.StreamHandler(stream, resource.ApplicationPolicyListType) -} - -func (s *server) StreamSubscriptionPolicies(stream subscription.SubscriptionPolicyDiscoveryService_StreamSubscriptionPoliciesServer) error { - return s.StreamHandler(stream, resource.SubscriptionPolicyListType) -} - -func (s *server) StreamApplicationKeyMappings(stream subscription.ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappingsServer) error { - return s.StreamHandler(stream, resource.ApplicationKeyMappingListType) -} - -func (s *server) StreamApplicationMappings(stream subscription.ApplicationMappingDiscoveryService_StreamApplicationMappingsServer) error { - return s.StreamHandler(stream, resource.ApplicationMappingListType) -} - -func (s *server) StreamKeyManagers(stream keymgt.KMDiscoveryService_StreamKeyManagersServer) error { - return s.StreamHandler(stream, resource.KeyManagerType) -} - -func (s *server) StreamTokens(stream keymgt.RevokedTokenDiscoveryService_StreamTokensServer) error { - return s.StreamHandler(stream, resource.RevokedTokensType) -} - -func (s *server) StreamAPKMgtApplications(stream apkmgt.APKMgtDiscoveryService_StreamAPKMgtApplicationsServer) error { - return s.StreamHandler(stream, resource.APKMgtApplicationType) -} func (s *server)StreamJWTIssuers(stream subscription.JWTIssuerDiscoveryService_StreamJWTIssuersServer) error { return s.StreamHandler(stream, resource.JWTIssuerListType) } diff --git a/common-controller/go.mod b/common-controller/go.mod index 41f019e42..f13833977 100644 --- a/common-controller/go.mod +++ b/common-controller/go.mod @@ -68,7 +68,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.0 // direct github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect diff --git a/common-controller/internal/cache/subscriptionDataStore.go b/common-controller/internal/cache/subscriptionDataStore.go index 7e4ab9abd..2ed931957 100644 --- a/common-controller/internal/cache/subscriptionDataStore.go +++ b/common-controller/internal/cache/subscriptionDataStore.go @@ -100,7 +100,7 @@ func (ods *SubscriptionDataStore) GetApplicationMappingFromStore(name types.Name func (ods *SubscriptionDataStore) DeleteApplicationFromStore(name types.NamespacedName) { ods.mu.Lock() defer ods.mu.Unlock() - logger.Debug("Deleting application from cache") + logger.Info("Deleting application from cache") delete(ods.applicationStore, name) } @@ -108,7 +108,7 @@ func (ods *SubscriptionDataStore) DeleteApplicationFromStore(name types.Namespac func (ods *SubscriptionDataStore) DeleteSubscriptionFromStore(name types.NamespacedName) { ods.mu.Lock() defer ods.mu.Unlock() - logger.Debug("Deleting subscription from cache") + logger.Info("Deleting subscription from cache") delete(ods.subscriptionStore, name) } @@ -116,6 +116,6 @@ func (ods *SubscriptionDataStore) DeleteSubscriptionFromStore(name types.Namespa func (ods *SubscriptionDataStore) DeleteApplicationMappingFromStore(name types.NamespacedName) { ods.mu.Lock() defer ods.mu.Unlock() - logger.Debug("Deleting application mapping from cache") + logger.Info("Deleting application mapping from cache") delete(ods.applicationMappingStore, name) } diff --git a/common-controller/internal/operator/constant/constant.go b/common-controller/internal/operator/constant/constant.go index a9bb47769..db35de637 100644 --- a/common-controller/internal/operator/constant/constant.go +++ b/common-controller/internal/operator/constant/constant.go @@ -32,19 +32,21 @@ const ( Delete string = "DELETED" ) +// Subscriprion events related constants const ( - APPLICATION_CREATED string = "APPLICATION_CREATED" - APPLICATION_UPDATED string = "APPLICATION_UPDATED" - APPLICATION_DELETED string = "APPLICATION_DELETED" - SUBSCRIPTION_CREATED string = "SUBSCRIPTION_CREATED" - SUBSCRIPTION_UPDATED string = "SUBSCRIPTION_UPDATED" - SUBSCRIPTION_DELETED string = "SUBSCRIPTION_DELETED" - APPLICATION_MAPPING_CREATED string = "APPLICATION_MAPPING_CREATED" - APPLICATION_MAPPING_UPDATED string = "APPLICATION_MAPPING_UPDATED" - APPLICATION_MAPPING_DELETED string = "APPLICATION_MAPPING_DELETED" - APPLICATION_KEY_MAPPING_CREATED string = "APPLICATION_KEY_MAPPING_CREATED" - APPLICATION_KEY_MAPPING_UPDATED string = "APPLICATION_KEY_MAPPING_UPDATED" - APPLICATION_KEY_MAPPING_DELETED string = "APPLICATION_KEY_MAPPING_DELETED" + ApplicationCreated string = "APPLICATION_CREATED" + ApplicationUpdated string = "APPLICATION_UPDATED" + ApplicationDeleted string = "APPLICATION_DELETED" + SubscriptionCreated string = "SUBSCRIPTION_CREATED" + SubscriptionUpdated string = "SUBSCRIPTION_UPDATED" + SubscriptionDeleted string = "SUBSCRIPTION_DELETED" + ApplicationMappingCreated string = "APPLICATION_MAPPING_CREATED" + ApplicationMappingUpdated string = "APPLICATION_MAPPING_UPDATED" + ApplicationMappingDeleted string = "APPLICATION_MAPPING_DELETED" + ApplicationKeyMappingCreated string = "APPLICATION_KEY_MAPPING_CREATED" + ApplicationKeyMappingUpdated string = "APPLICATION_KEY_MAPPING_UPDATED" + ApplicationKeyMappingDeleted string = "APPLICATION_KEY_MAPPING_DELETED" + AllEvnts string = "ALL_EVENTS" ) // Environment variable names and default values diff --git a/common-controller/internal/operator/controllers/cp/application_controller.go b/common-controller/internal/operator/controllers/cp/application_controller.go index 9c681ee92..7a0fd47c4 100644 --- a/common-controller/internal/operator/controllers/cp/application_controller.go +++ b/common-controller/internal/operator/controllers/cp/application_controller.go @@ -88,7 +88,7 @@ func (applicationReconciler *ApplicationReconciler) Reconcile(ctx context.Contex applicationKey := req.NamespacedName var applicationList = new(cpv1alpha2.ApplicationList) - loggers.LoggerAPKOperator.Debugf("Reconciling application: %v", applicationKey.String()) + loggers.LoggerAPKOperator.Infof("Reconciling application: %v", applicationKey.String()) if err := applicationReconciler.client.List(ctx, applicationList); err != nil { return reconcile.Result{}, fmt.Errorf("failed to get applications %s/%s", applicationKey.Namespace, applicationKey.Name) @@ -97,24 +97,28 @@ func (applicationReconciler *ApplicationReconciler) Reconcile(ctx context.Contex if err := applicationReconciler.client.Get(ctx, req.NamespacedName, &application); err != nil { if k8error.IsNotFound(err) { applicationSpec, found := applicationReconciler.ods.GetApplicationFromStore(applicationKey) + loggers.LoggerAPKOperator.Infof("Application cr not available in k8s") + loggers.LoggerAPKOperator.Infof("cached Application spec: %v,%v", applicationSpec, found) if found { utils.SendAppDeletionEvent(applicationKey.Name, applicationSpec) applicationReconciler.ods.DeleteApplicationFromStore(applicationKey) - return ctrl.Result{}, nil } else { - loggers.LoggerAPKOperator.Debugf("Application %s/%s does not exist in k8s", applicationKey.Namespace, applicationKey.Name) + loggers.LoggerAPKOperator.Infof("Application %s/%s does not exist in k8s", applicationKey.Namespace, applicationKey.Name) } - } else { - applicationSpec, found := applicationReconciler.ods.GetApplicationFromStore(applicationKey) - if found { - // update - utils.SendAppUpdateEvent(applicationKey.Name, applicationSpec, application.Spec) + } + } else { + loggers.LoggerAPKOperator.Infof("Application cr available in k8s") + applicationSpec, found := applicationReconciler.ods.GetApplicationFromStore(applicationKey) + if found { + // update + loggers.LoggerAPKOperator.Infof("Application in ods") + utils.SendAppUpdateEvent(applicationKey.Name, applicationSpec, application.Spec) - } else { - utils.SendAddApplicationEvent(application) - } - applicationReconciler.ods.AddorUpdateApplicationToStore(applicationKey, application.Spec) + } else { + loggers.LoggerAPKOperator.Infof("Application in ods consider as update") + utils.SendAddApplicationEvent(application) } + applicationReconciler.ods.AddorUpdateApplicationToStore(applicationKey, application.Spec) } sendAppUpdates(applicationList) return ctrl.Result{}, nil diff --git a/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go b/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go index 837aa57fc..fc395bc83 100644 --- a/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go +++ b/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go @@ -94,22 +94,22 @@ func (r *ApplicationMappingReconciler) Reconcile(ctx context.Context, req ctrl.R return reconcile.Result{}, fmt.Errorf("failed to get application mappings %s/%s", applicationMappingKey.Namespace, applicationMappingKey.Name) } + sendUpdates(applicationMappingList) var applicationMapping cpv1alpha2.ApplicationMapping if err := r.client.Get(ctx, req.NamespacedName, &applicationMapping); err != nil { if k8error.IsNotFound(err) { applicationMapping, found := r.ods.GetApplicationMappingFromStore(applicationMappingKey) - if !found { - loggers.LoggerAPKOperator.Debugf("Application mapping %s/%s not found. Ignoring since object must be deleted", applicationMappingKey.Namespace, applicationMappingKey.Name) - } else { + if found { utils.SendDeleteApplicationMappingEvent(applicationMappingKey.Name, applicationMapping) r.ods.DeleteApplicationMappingFromStore(applicationMappingKey) - return ctrl.Result{}, nil + } else { + loggers.LoggerAPKOperator.Debugf("Application mapping %s/%s not found. Ignoring since object must be deleted", applicationMappingKey.Namespace, applicationMappingKey.Name) } - } else { - utils.SendCreateApplicationMappingEvent(applicationMapping) } + } else { + utils.SendCreateApplicationMappingEvent(applicationMapping) + r.ods.AddorUpdateApplicationMappingToStore(applicationMappingKey, applicationMapping.Spec) } - sendUpdates(applicationMappingList) return ctrl.Result{}, nil } diff --git a/common-controller/internal/operator/controllers/cp/subscription_controller.go b/common-controller/internal/operator/controllers/cp/subscription_controller.go index 0933b37ff..2d62c4d1c 100644 --- a/common-controller/internal/operator/controllers/cp/subscription_controller.go +++ b/common-controller/internal/operator/controllers/cp/subscription_controller.go @@ -107,10 +107,10 @@ func (subscriptionReconciler *SubscriptionReconciler) Reconcile(ctx context.Cont subscriptionReconciler.ods.DeleteSubscriptionFromStore(subscriptionKey) return ctrl.Result{}, nil } - } else { - utils.SendAddSubscriptionEvent(subscription) - subscriptionReconciler.ods.AddorUpdateSubscriptionToStore(subscriptionKey, subscription.Spec) } + } else { + utils.SendAddSubscriptionEvent(subscription) + subscriptionReconciler.ods.AddorUpdateSubscriptionToStore(subscriptionKey, subscription.Spec) } return ctrl.Result{}, nil } diff --git a/common-controller/internal/server/event_server.go b/common-controller/internal/server/event_server.go index 16aa18e3f..e9cae33f4 100644 --- a/common-controller/internal/server/event_server.go +++ b/common-controller/internal/server/event_server.go @@ -4,6 +4,7 @@ import ( "log" apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" + "github.com/wso2/apk/common-controller/internal/loggers" utils "github.com/wso2/apk/common-controller/internal/utils" "google.golang.org/grpc/metadata" ) @@ -18,12 +19,14 @@ func (s EventServer) StreamEvents(req *apkmgt.Request, srv apkmgt.EventStreamSer // Read metadata from the request context md, ok := metadata.FromIncomingContext(srv.Context()) if !ok { - log.Printf("missing metadata") + loggers.LoggerAPKOperator.Errorf("error : %v", "Failed to get metadata from the request context") return nil // Handle the case where metadata is not present } enforcerID := md.Get("enforcer-uuid") + loggers.LoggerAPKOperator.Debugf("Enforcer ID : %v", enforcerID[0]) utils.AddClientConnection(enforcerID[0], srv) + utils.SendInitialEvent(srv) for { if srv.Context().Done() == nil { utils.DeleteClientConnection(enforcerID[0]) diff --git a/common-controller/internal/utils/event_utils.go b/common-controller/internal/utils/event_utils.go index 4adc378ac..68fe3f495 100644 --- a/common-controller/internal/utils/event_utils.go +++ b/common-controller/internal/utils/event_utils.go @@ -3,6 +3,8 @@ package utils import ( time "time" + "github.com/google/uuid" + apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" "github.com/wso2/apk/common-controller/internal/loggers" cpv1alpha2 "github.com/wso2/apk/common-controller/internal/operator/apis/cp/v1alpha2" @@ -15,7 +17,7 @@ func SendAppDeletionEvent(applicationUUID string, applicationSpec cpv1alpha2.App milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: applicationUUID, - Type: constants.APPLICATION_DELETED, + Type: constants.ApplicationDeleted, TimeStamp: milliseconds, Application: &subscription.Application{ Uuid: applicationUUID, @@ -25,7 +27,7 @@ func SendAppDeletionEvent(applicationUUID string, applicationSpec cpv1alpha2.App Attributes: applicationSpec.Attributes, }, } - sendEvent(event) + sendEvent(&event) } // SendAppUpdateEvent sends an application update event to the enforcer @@ -34,7 +36,7 @@ func SendAppUpdateEvent(applicationUUID string, oldApplicationSpec cpv1alpha2.Ap milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: applicationUUID, - Type: constants.APPLICATION_UPDATED, + Type: constants.ApplicationUpdated, TimeStamp: milliseconds, Application: &subscription.Application{ Uuid: applicationUUID, @@ -44,9 +46,10 @@ func SendAppUpdateEvent(applicationUUID string, oldApplicationSpec cpv1alpha2.Ap Attributes: newApplicationSpec.Attributes, }, } - sendEvent(event) - SendDeleteApplicationKeyMappingEvent(applicationUUID, oldApplicationSpec) - SendApplicationKeyMappingEvent(applicationUUID, newApplicationSpec) + loggers.LoggerAPKOperator.Infof("Sending event to all clients: %v", &event) + sendEvent(&event) + sendDeleteApplicationKeyMappingEvent(applicationUUID, oldApplicationSpec) + sendApplicationKeyMappingEvent(applicationUUID, newApplicationSpec) } // SendAddApplicationEvent sends an application creation event to the enforcer @@ -55,7 +58,7 @@ func SendAddApplicationEvent(application cpv1alpha2.Application) { milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: application.ObjectMeta.Name, - Type: constants.APPLICATION_CREATED, + Type: constants.ApplicationCreated, TimeStamp: milliseconds, Application: &subscription.Application{ Uuid: application.ObjectMeta.Name, @@ -65,7 +68,8 @@ func SendAddApplicationEvent(application cpv1alpha2.Application) { Attributes: application.Spec.Attributes, }, } - sendEvent(event) + sendEvent(&event) + sendApplicationKeyMappingEvent(application.ObjectMeta.Name, application.Spec) } // SendAddSubscriptionEvent sends an subscription creation event to the enforcer @@ -74,7 +78,7 @@ func SendAddSubscriptionEvent(sub cpv1alpha2.Subscription) { milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: sub.ObjectMeta.Name, - Type: constants.SUBSCRIPTION_CREATED, + Type: constants.SubscriptionCreated, TimeStamp: milliseconds, Subscription: &subscription.Subscription{ Uuid: sub.ObjectMeta.Name, @@ -86,7 +90,7 @@ func SendAddSubscriptionEvent(sub cpv1alpha2.Subscription) { }, }, } - sendEvent(event) + sendEvent(&event) } // SendDeleteSubscriptionEvent sends an subscription deletion event to the enforcer @@ -95,7 +99,7 @@ func SendDeleteSubscriptionEvent(subscriptionUUID string, subscriptionSpec cpv1a milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: subscriptionUUID, - Type: constants.SUBSCRIPTION_DELETED, + Type: constants.SubscriptionDeleted, TimeStamp: milliseconds, Subscription: &subscription.Subscription{ Uuid: subscriptionUUID, @@ -107,7 +111,7 @@ func SendDeleteSubscriptionEvent(subscriptionUUID string, subscriptionSpec cpv1a }, }, } - sendEvent(event) + sendEvent(&event) } // SendCreateApplicationMappingEvent sends an application mapping event to the enforcer @@ -116,7 +120,7 @@ func SendCreateApplicationMappingEvent(applicationMapping cpv1alpha2.Application milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: applicationMapping.ObjectMeta.Name, - Type: constants.APPLICATION_MAPPING_CREATED, + Type: constants.ApplicationMappingCreated, TimeStamp: milliseconds, ApplicationMapping: &subscription.ApplicationMapping{ Uuid: applicationMapping.ObjectMeta.Name, @@ -124,7 +128,7 @@ func SendCreateApplicationMappingEvent(applicationMapping cpv1alpha2.Application SubscriptionRef: applicationMapping.Spec.SubscriptionRef, }, } - sendEvent(event) + sendEvent(&event) } // SendDeleteApplicationMappingEvent sends an application mapping deletion event to the enforcer @@ -133,7 +137,7 @@ func SendDeleteApplicationMappingEvent(applicationMappingUUID string, applicatio milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: applicationMappingUUID, - Type: constants.APPLICATION_DELETED, + Type: constants.ApplicationMappingDeleted, TimeStamp: milliseconds, ApplicationMapping: &subscription.ApplicationMapping{ Uuid: applicationMappingUUID, @@ -141,9 +145,9 @@ func SendDeleteApplicationMappingEvent(applicationMappingUUID string, applicatio SubscriptionRef: applicationMappingSpec.SubscriptionRef, }, } - sendEvent(event) + sendEvent(&event) } -func SendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKeyMapping cpv1alpha2.ApplicationSpec) { +func sendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKeyMapping cpv1alpha2.ApplicationSpec) { currentTime := time.Now() milliseconds := currentTime.UnixNano() / int64(time.Millisecond) var oauth2SecurityScheme = applicationKeyMapping.SecuritySchemes.OAuth2 @@ -151,7 +155,7 @@ func SendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKey for _, env := range oauth2SecurityScheme.Environments { event := subscription.Event{ Uuid: applicationUUID, - Type: constants.APPLICATION_KEY_MAPPING_DELETED, + Type: constants.ApplicationKeyMappingDeleted, TimeStamp: milliseconds, ApplicationKeyMapping: &subscription.ApplicationKeyMapping{ ApplicationUUID: applicationUUID, @@ -161,11 +165,11 @@ func SendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKey EnvID: env.EnvID, }, } - sendEvent(event) + sendEvent(&event) } } } -func SendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1alpha2.ApplicationSpec) { +func sendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1alpha2.ApplicationSpec) { currentTime := time.Now() milliseconds := currentTime.UnixNano() / int64(time.Millisecond) var oauth2SecurityScheme = applicationSpec.SecuritySchemes.OAuth2 @@ -173,7 +177,7 @@ func SendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1 for _, env := range oauth2SecurityScheme.Environments { event := subscription.Event{ Uuid: applicationUUID, - Type: constants.APPLICATION_KEY_MAPPING_CREATED, + Type: constants.ApplicationKeyMappingCreated, TimeStamp: milliseconds, ApplicationKeyMapping: &subscription.ApplicationKeyMapping{ ApplicationUUID: applicationUUID, @@ -183,17 +187,31 @@ func SendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1 EnvID: env.EnvID, }, } - sendEvent(event) + sendEvent(&event) } } } -func sendEvent(event subscription.Event) { - for clientId, stream := range GetAllClientConnections() { - err := stream.Send(&event) +func sendEvent(event *subscription.Event) { + loggers.LoggerAPKOperator.Infof("Sending event to all clients: %v", event) + for clientID, stream := range GetAllClientConnections() { + err := stream.Send(event) if err != nil { - loggers.LoggerAPK.Errorf("Error sending event to client %s: %v", clientId, err) + loggers.LoggerAPKOperator.Errorf("Error sending event to client %s: %v", clientID, err) } else { - loggers.LoggerAPK.Debugf("Event sent to client %s", clientId) + loggers.LoggerAPKOperator.Infof("Event sent to client %s", clientID) } } } + +// SendInitialEvent sends initial event to the enforcer +func SendInitialEvent(srv apkmgt.EventStreamService_StreamEventsServer) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + + event := subscription.Event{ + Uuid: uuid.New().String(), + Type: constants.AllEvnts, + TimeStamp: milliseconds, + } + srv.Send(&event) +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java index dbe7de432..2989feba0 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java @@ -66,11 +66,9 @@ import java.io.IOException; import java.lang.reflect.Field; -import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; -import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.security.interfaces.RSAPublicKey; @@ -109,18 +107,9 @@ private ConfigHolder() { } private void loadKeyStore() { - - try { - Certificate cert = - TLSUtils.getCertificateFromFile(getEnvVarConfig().getEnforcerPublicKeyPath()); - Key key = JWTUtils.getPrivateKey(getEnvVarConfig().getEnforcerPrivateKeyPath()); - keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, null); - keyStore.setKeyEntry("client-keys", key, null, new Certificate[]{cert}); - } catch (EnforcerException | CertificateException | IOException | KeyStoreException | - NoSuchAlgorithmException e) { - logger.error("Error occurred while configuring KeyStore", e); - } + String certPath = getEnvVarConfig().getEnforcerPublicKeyPath(); + String keyPath = getEnvVarConfig().getEnforcerPrivateKeyPath(); + keyStore = TLSUtils.getKeyStore(certPath, keyPath); } public static ConfigHolder getInstance() { diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/RevokedTokenDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/RevokedTokenDiscoveryClient.java deleted file mode 100644 index 93c5b026d..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/RevokedTokenDiscoveryClient.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) 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. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.keymgt.RevokedToken; -import org.wso2.apk.enforcer.discovery.service.keymgt.RevokedTokenDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.security.jwt.validator.RevokedJWTDataHolder; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with API discovery service at the adapter. - */ -public class RevokedTokenDiscoveryClient implements Runnable { - - private static RevokedTokenDiscoveryClient instance; - private ManagedChannel channel; - private RevokedTokenDiscoveryServiceGrpc.RevokedTokenDiscoveryServiceStub stub; - private static final Logger logger = LogManager.getLogger(RevokedTokenDiscoveryClient.class); - private final RevokedJWTDataHolder revokedJWTDataHolder; - private StreamObserver reqObserver; - private static final Logger log = LogManager.getLogger(RevokedTokenDiscoveryClient.class); - private final String host; - private final String hostname; - private final int port; - /** - * This is a reference to the latest received response from the ADS. - *

- * Usage: When ack/nack a DiscoveryResponse this value is used to identify the - * latest received DiscoveryResponse which may not have been acked/nacked so far. - *

- */ - private DiscoveryResponse latestReceived; - /** - * This is a reference to the latest acked response from the ADS. - *

- * Usage: When nack a DiscoveryResponse this value is used to find the latest - * successfully processed DiscoveryResponse. Information sent in the nack request - * will contain information about this response value. - *

- */ - private DiscoveryResponse latestACKed; - /** - * Node struct for the discovery client - */ - private final Node node; - - private RevokedTokenDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.revokedJWTDataHolder = RevokedJWTDataHolder.getInstance(); - initConnection(); - // Since revoked tokens should be received by every enforcer, adapter creates a - // common snapshot for revoked tokens. Hence each enforces requests data using the - // common enforcer label to avoid redundent snapshots - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - log.error("Revoked tokens discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(log, host, port, hostname); - this.stub = RevokedTokenDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopRevokedTokenDiscoveryScheduling(); - } - } - - public static RevokedTokenDiscoveryClient getInstance() { - if (instance == null) { - String adsHost = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHost(); - String adsHostname = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHostname(); - int adsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getAdapterXdsPort()); - instance = new RevokedTokenDiscoveryClient(adsHost, adsHostname, adsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchRevokedTokens(); - } - - public void watchRevokedTokens() { - // TODO: (Praminda) implement a deadline with retries - int maxSize = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getXdsMaxMsgSize()); - reqObserver = stub.withMaxInboundMessageSize(maxSize).streamTokens(new StreamObserver<>() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("Revoked token event received with version : " + response.getVersionInfo()); - XdsSchedulerManager.getInstance().stopRevokedTokenDiscoveryScheduling(); - latestReceived = response; - try { - List tokens = handleResponse(response); - handleRevokedTokens(tokens); - // TODO: (Praminda) fix recursive ack on ack failure - ack(); - } catch (Exception e) { - logger.info(e); - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during revoked token discovery", throwable); - XdsSchedulerManager.getInstance().startRevokedTokenDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving revoke tokens"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.REVOKED_TOKEN_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.REVOKED_TOKEN_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in revoked token discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. - * This is part of the xDS communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.REVOKED_TOKEN_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.REVOKED_TOKEN_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } - - private void handleRevokedTokens(List tokens) { - for (RevokedToken revokedToken : tokens) { - revokedJWTDataHolder.addRevokedJWTToMap(revokedToken.getJti(), revokedToken.getExpirytime()); - } - } - - private List handleResponse(DiscoveryResponse response) throws InvalidProtocolBufferException { - List apis = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - apis.add(res.unpack(RevokedToken.class)); - } - return apis; - } - - public void shutdown() throws InterruptedException { - channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java index 5440c8bda..aeff25ec6 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java @@ -23,7 +23,7 @@ import org.wso2.apk.enforcer.discovery.ApiListDiscoveryClient; import org.wso2.apk.enforcer.discovery.ConfigDiscoveryClient; import org.wso2.apk.enforcer.discovery.JWTIssuerDiscoveryClient; -import org.wso2.apk.enforcer.discovery.RevokedTokenDiscoveryClient; +import org.wso2.apk.enforcer.subscription.EventingGrpcClient; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -38,19 +38,22 @@ public class XdsSchedulerManager { private static int retryPeriod; private static volatile XdsSchedulerManager instance; private static ScheduledExecutorService discoveryClientScheduler; + private static ScheduledExecutorService eventingScheduler; private ScheduledFuture apiDiscoveryScheduledFuture; private ScheduledFuture apiDiscoveryListScheduledFuture; private ScheduledFuture jwtIssuerDiscoveryScheduledFuture; - private ScheduledFuture revokedTokenDiscoveryScheduledFuture; + private ScheduledFuture eventingScheduledFuture; private ScheduledFuture configDiscoveryScheduledFuture; public static XdsSchedulerManager getInstance() { + if (instance == null) { synchronized (XdsSchedulerManager.class) { if (instance == null) { instance = new XdsSchedulerManager(); discoveryClientScheduler = Executors.newSingleThreadScheduledExecutor(); + eventingScheduler = Executors.newSingleThreadScheduledExecutor(); retryPeriod = Integer.parseInt(EnvVarConfig.getInstance().getXdsRetryPeriod()); } } @@ -59,6 +62,7 @@ public static XdsSchedulerManager getInstance() { } public synchronized void startAPIDiscoveryScheduling() { + if (apiDiscoveryScheduledFuture == null || apiDiscoveryScheduledFuture.isDone()) { apiDiscoveryScheduledFuture = discoveryClientScheduler .scheduleWithFixedDelay(ApiDiscoveryClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); @@ -66,12 +70,14 @@ public synchronized void startAPIDiscoveryScheduling() { } public synchronized void stopAPIDiscoveryScheduling() { + if (apiDiscoveryScheduledFuture != null && !apiDiscoveryScheduledFuture.isDone()) { apiDiscoveryScheduledFuture.cancel(false); } } public synchronized void startAPIListDiscoveryScheduling() { + if (apiDiscoveryListScheduledFuture == null || apiDiscoveryListScheduledFuture.isDone()) { apiDiscoveryListScheduledFuture = discoveryClientScheduler .scheduleWithFixedDelay(ApiListDiscoveryClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); @@ -79,6 +85,7 @@ public synchronized void startAPIListDiscoveryScheduling() { } public synchronized void stopAPIListDiscoveryScheduling() { + if (apiDiscoveryListScheduledFuture != null && !apiDiscoveryListScheduledFuture.isDone()) { apiDiscoveryListScheduledFuture.cancel(false); } @@ -92,27 +99,30 @@ public synchronized void startJWTIssuerDiscoveryScheduling() { } } + public synchronized void startEventScheduling() { + + if (eventingScheduledFuture == null || eventingScheduledFuture.isDone()) { + eventingScheduledFuture = eventingScheduler + .scheduleWithFixedDelay(EventingGrpcClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); + } + } + public synchronized void stopJWTIssuerDiscoveryScheduling() { + if (jwtIssuerDiscoveryScheduledFuture != null && !jwtIssuerDiscoveryScheduledFuture.isDone()) { jwtIssuerDiscoveryScheduledFuture.cancel(false); } } - public synchronized void startRevokedTokenDiscoveryScheduling() { - if (revokedTokenDiscoveryScheduledFuture == null || revokedTokenDiscoveryScheduledFuture.isDone()) { - revokedTokenDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(RevokedTokenDiscoveryClient.getInstance(), 1, retryPeriod, - TimeUnit.SECONDS); - } - } + public synchronized void stopEventStreamScheduling() { - public synchronized void stopRevokedTokenDiscoveryScheduling() { - if (revokedTokenDiscoveryScheduledFuture != null && !revokedTokenDiscoveryScheduledFuture.isDone()) { - revokedTokenDiscoveryScheduledFuture.cancel(false); + if (eventingScheduledFuture != null && !eventingScheduledFuture.isDone()) { + eventingScheduledFuture.cancel(false); } } public synchronized void startConfigDiscoveryScheduling() { + if (configDiscoveryScheduledFuture == null || configDiscoveryScheduledFuture.isDone()) { configDiscoveryScheduledFuture = discoveryClientScheduler .scheduleWithFixedDelay(ConfigDiscoveryClient.getInstance(), 1, retryPeriod, @@ -121,6 +131,7 @@ public synchronized void startConfigDiscoveryScheduling() { } public synchronized void stopConfigDiscoveryScheduling() { + if (configDiscoveryScheduledFuture != null && !configDiscoveryScheduledFuture.isDone()) { configDiscoveryScheduledFuture.cancel(false); } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/APIOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/APIOrBuilder.java deleted file mode 100644 index 23721994a..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/APIOrBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface APIOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.API) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * repeated string versions = 2; - * @return A list containing the versions. - */ - java.util.List - getVersionsList(); - /** - * repeated string versions = 2; - * @return The count of versions. - */ - int getVersionsCount(); - /** - * repeated string versions = 2; - * @param index The index of the element to return. - * @return The versions at the given index. - */ - java.lang.String getVersions(int index); - /** - * repeated string versions = 2; - * @param index The index of the value to return. - * @return The bytes of the versions at the given index. - */ - com.google.protobuf.ByteString - getVersionsBytes(int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingList.java deleted file mode 100644 index bce9b946a..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationKeyMappingList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationKeyMappingList} - */ -public final class ApplicationKeyMappingList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationKeyMappingList) - ApplicationKeyMappingListOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationKeyMappingList.newBuilder() to construct. - private ApplicationKeyMappingList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationKeyMappingList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationKeyMappingList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationKeyMappingList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationKeyMappingList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationKeyMappingList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationKeyMappingList) - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationKeyMappingList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationKeyMappingList) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationKeyMappingList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationKeyMappingList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListOrBuilder.java deleted file mode 100644 index 463dc8bb8..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationKeyMappingListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationKeyMappingList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getList(int index); - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListProto.java deleted file mode 100644 index 15a7e285a..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListProto.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationKeyMappingListProto { - private ApplicationKeyMappingListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n>wso2/discovery/subscription/applicatio" + - "n_key_mapping_list.proto\022\033wso2.discovery" + - ".subscription\0329wso2/discovery/subscripti" + - "on/application_key_mapping.proto\"]\n\031Appl" + - "icationKeyMappingList\022@\n\004list\030\002 \003(\01322.ws" + - "o2.discovery.subscription.ApplicationKey" + - "MappingB\241\001\n,org.wso2.apk.enforcer.discov" + - "ery.subscriptionB\036ApplicationKeyMappingL" + - "istProtoP\001ZOgithub.com/envoyproxy/go-con" + - "trol-plane/wso2/discovery/subscription;s" + - "ubscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationList.java deleted file mode 100644 index 26a00a637..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationList} - */ -public final class ApplicationList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationList) - ApplicationListOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationList.newBuilder() to construct. - private ApplicationList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Application.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Application getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationList other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationList) - org.wso2.apk.enforcer.discovery.subscription.ApplicationListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationList build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationList result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.Application value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.Application.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.Application value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.Application value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.Application.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.Application.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationList) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListOrBuilder.java deleted file mode 100644 index bf2c5f5f0..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.Application getList(int index); - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListProto.java deleted file mode 100644 index 92a66d4e5..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListProto.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationListProto { - private ApplicationListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n2wso2/discovery/subscription/applicatio" + - "n_list.proto\022\033wso2.discovery.subscriptio" + - "n\032-wso2/discovery/subscription/applicati" + - "on.proto\"I\n\017ApplicationList\0226\n\004list\030\002 \003(" + - "\0132(.wso2.discovery.subscription.Applicat" + - "ionB\227\001\n,org.wso2.apk.enforcer.discovery." + - "subscriptionB\024ApplicationListProtoP\001ZOgi" + - "thub.com/envoyproxy/go-control-plane/wso" + - "2/discovery/subscription;subscriptionb\006p" + - "roto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_ApplicationList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingList.java deleted file mode 100644 index de67b9d94..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationMappingList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationMappingList} - */ -public final class ApplicationMappingList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationMappingList) - ApplicationMappingListOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationMappingList.newBuilder() to construct. - private ApplicationMappingList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationMappingList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationMappingList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationMappingList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationMappingList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationMappingList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationMappingList) - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationMappingList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationMappingList) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationMappingList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationMappingList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListOrBuilder.java deleted file mode 100644 index 2aed5e587..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationMappingListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationMappingList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getList(int index); - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListProto.java deleted file mode 100644 index 9e3e5715a..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListProto.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationMappingListProto { - private ApplicationMappingListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationMappingList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n9wso2/discovery/subscription/applicatio" + - "nmapping_list.proto\022\033wso2.discovery.subs" + - "cription\0324wso2/discovery/subscription/ap" + - "plicationmapping.proto\"W\n\026ApplicationMap" + - "pingList\022=\n\004list\030\002 \003(\0132/.wso2.discovery." + - "subscription.ApplicationMappingB\236\001\n,org." + - "wso2.apk.enforcer.discovery.subscription" + - "B\033ApplicationMappingListProtoP\001ZOgithub." + - "com/envoyproxy/go-control-plane/wso2/dis" + - "covery/subscription;subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationMappingList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicy.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicy.java deleted file mode 100644 index 5251d1eb2..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicy.java +++ /dev/null @@ -1,831 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationPolicy data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationPolicy} - */ -public final class ApplicationPolicy extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationPolicy) - ApplicationPolicyOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationPolicy.newBuilder() to construct. - private ApplicationPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationPolicy() { - name_ = ""; - quotaType_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationPolicy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationPolicy( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - id_ = input.readInt32(); - break; - } - case 16: { - - tenantId_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - quotaType_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private int id_; - /** - * int32 id = 1; - * @return The id. - */ - @java.lang.Override - public int getId() { - return id_; - } - - public static final int TENANTID_FIELD_NUMBER = 2; - private int tenantId_; - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - @java.lang.Override - public int getTenantId() { - return tenantId_; - } - - public static final int NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object name_; - /** - * string name = 3; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 3; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int QUOTATYPE_FIELD_NUMBER = 4; - private volatile java.lang.Object quotaType_; - /** - * string quotaType = 4; - * @return The quotaType. - */ - @java.lang.Override - public java.lang.String getQuotaType() { - java.lang.Object ref = quotaType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - quotaType_ = s; - return s; - } - } - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getQuotaTypeBytes() { - java.lang.Object ref = quotaType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - quotaType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0) { - output.writeInt32(1, id_); - } - if (tenantId_ != 0) { - output.writeInt32(2, tenantId_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); - } - if (!getQuotaTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, quotaType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, id_); - } - if (tenantId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, tenantId_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); - } - if (!getQuotaTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, quotaType_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy) obj; - - if (getId() - != other.getId()) return false; - if (getTenantId() - != other.getTenantId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getQuotaType() - .equals(other.getQuotaType())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId(); - hash = (37 * hash) + TENANTID_FIELD_NUMBER; - hash = (53 * hash) + getTenantId(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + QUOTATYPE_FIELD_NUMBER; - hash = (53 * hash) + getQuotaType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationPolicy data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationPolicy} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationPolicy) - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0; - - tenantId_ = 0; - - name_ = ""; - - quotaType_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy(this); - result.id_ = id_; - result.tenantId_ = tenantId_; - result.name_ = name_; - result.quotaType_ = quotaType_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.getDefaultInstance()) return this; - if (other.getId() != 0) { - setId(other.getId()); - } - if (other.getTenantId() != 0) { - setTenantId(other.getTenantId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getQuotaType().isEmpty()) { - quotaType_ = other.quotaType_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int id_ ; - /** - * int32 id = 1; - * @return The id. - */ - @java.lang.Override - public int getId() { - return id_; - } - /** - * int32 id = 1; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(int value) { - - id_ = value; - onChanged(); - return this; - } - /** - * int32 id = 1; - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = 0; - onChanged(); - return this; - } - - private int tenantId_ ; - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - @java.lang.Override - public int getTenantId() { - return tenantId_; - } - /** - * int32 tenantId = 2; - * @param value The tenantId to set. - * @return This builder for chaining. - */ - public Builder setTenantId(int value) { - - tenantId_ = value; - onChanged(); - return this; - } - /** - * int32 tenantId = 2; - * @return This builder for chaining. - */ - public Builder clearTenantId() { - - tenantId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 3; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 3; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 3; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 3; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 3; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object quotaType_ = ""; - /** - * string quotaType = 4; - * @return The quotaType. - */ - public java.lang.String getQuotaType() { - java.lang.Object ref = quotaType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - quotaType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - public com.google.protobuf.ByteString - getQuotaTypeBytes() { - java.lang.Object ref = quotaType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - quotaType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string quotaType = 4; - * @param value The quotaType to set. - * @return This builder for chaining. - */ - public Builder setQuotaType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - quotaType_ = value; - onChanged(); - return this; - } - /** - * string quotaType = 4; - * @return This builder for chaining. - */ - public Builder clearQuotaType() { - - quotaType_ = getDefaultInstance().getQuotaType(); - onChanged(); - return this; - } - /** - * string quotaType = 4; - * @param value The bytes for quotaType to set. - * @return This builder for chaining. - */ - public Builder setQuotaTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - quotaType_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationPolicy) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationPolicy) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationPolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationPolicy(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyList.java deleted file mode 100644 index dc6879b5e..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationPolicyList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationPolicyList} - */ -public final class ApplicationPolicyList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationPolicyList) - ApplicationPolicyListOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationPolicyList.newBuilder() to construct. - private ApplicationPolicyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationPolicyList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationPolicyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationPolicyList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationPolicyList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationPolicyList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationPolicyList) - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationPolicyList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationPolicyList) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationPolicyList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationPolicyList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListOrBuilder.java deleted file mode 100644 index 8d6e2c3ed..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationPolicyListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationPolicyList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getList(int index); - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListProto.java deleted file mode 100644 index 57539daa8..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListProto.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationPolicyListProto { - private ApplicationPolicyListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationPolicyList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n9wso2/discovery/subscription/applicatio" + - "n_policy_list.proto\022\033wso2.discovery.subs" + - "cription\0324wso2/discovery/subscription/ap" + - "plication_policy.proto\"U\n\025ApplicationPol" + - "icyList\022<\n\004list\030\002 \003(\0132..wso2.discovery.s" + - "ubscription.ApplicationPolicyB\235\001\n,org.ws" + - "o2.apk.enforcer.discovery.subscriptionB\032" + - "ApplicationPolicyListProtoP\001ZOgithub.com" + - "/envoyproxy/go-control-plane/wso2/discov" + - "ery/subscription;subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationPolicyList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyOrBuilder.java deleted file mode 100644 index f8f865692..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyOrBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationPolicyOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationPolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 id = 1; - * @return The id. - */ - int getId(); - - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - int getTenantId(); - - /** - * string name = 3; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 3; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string quotaType = 4; - * @return The quotaType. - */ - java.lang.String getQuotaType(); - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - com.google.protobuf.ByteString - getQuotaTypeBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyProto.java deleted file mode 100644 index 9d7e5df09..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyProto.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationPolicyProto { - private ApplicationPolicyProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationPolicy_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n4wso2/discovery/subscription/applicatio" + - "n_policy.proto\022\033wso2.discovery.subscript" + - "ion\"R\n\021ApplicationPolicy\022\n\n\002id\030\001 \001(\005\022\020\n\010" + - "tenantId\030\002 \001(\005\022\014\n\004name\030\003 \001(\t\022\021\n\tquotaTyp" + - "e\030\004 \001(\tB\231\001\n,org.wso2.apk.enforcer.discov" + - "ery.subscriptionB\026ApplicationPolicyProto" + - "P\001ZOgithub.com/envoyproxy/go-control-pla" + - "ne/wso2/discovery/subscription;subscript" + - "ionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationPolicy_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor, - new java.lang.String[] { "Id", "TenantId", "Name", "QuotaType", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/AuthenticationOptionOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/AuthenticationOptionOrBuilder.java deleted file mode 100644 index 4e8065e1c..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/AuthenticationOptionOrBuilder.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface AuthenticationOptionOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.AuthenticationOption) - com.google.protobuf.MessageOrBuilder { - - /** - * string type = 1; - * @return The type. - */ - java.lang.String getType(); - /** - * string type = 1; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - *
-   * MTLS mTLS = 3;
-   * BasicAuth basicAuth = 4;
-   * APIKey apiKey = 5;
-   * IPRange IPRange = 6;
-   * 
- * - * .wso2.discovery.subscription.OAuth2 oAuth2 = 2; - * @return Whether the oAuth2 field is set. - */ - boolean hasOAuth2(); - /** - *
-   * MTLS mTLS = 3;
-   * BasicAuth basicAuth = 4;
-   * APIKey apiKey = 5;
-   * IPRange IPRange = 6;
-   * 
- * - * .wso2.discovery.subscription.OAuth2 oAuth2 = 2; - * @return The oAuth2. - */ - org.wso2.apk.enforcer.discovery.subscription.OAuth2 getOAuth2(); - /** - *
-   * MTLS mTLS = 3;
-   * BasicAuth basicAuth = 4;
-   * APIKey apiKey = 5;
-   * IPRange IPRange = 6;
-   * 
- * - * .wso2.discovery.subscription.OAuth2 oAuth2 = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder getOAuth2OrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Environment.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Environment.java deleted file mode 100644 index d2774073f..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Environment.java +++ /dev/null @@ -1,833 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.Environment} - */ -public final class Environment extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.Environment) - EnvironmentOrBuilder { -private static final long serialVersionUID = 0L; - // Use Environment.newBuilder() to construct. - private Environment(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Environment() { - envID_ = ""; - applicationIdentifier_ = ""; - keyType_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Environment(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Environment( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - envID_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - applicationIdentifier_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - keyType_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Environment.class, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder.class); - } - - public static final int ENVID_FIELD_NUMBER = 1; - private volatile java.lang.Object envID_; - /** - * string envID = 1; - * @return The envID. - */ - @java.lang.Override - public java.lang.String getEnvID() { - java.lang.Object ref = envID_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - envID_ = s; - return s; - } - } - /** - * string envID = 1; - * @return The bytes for envID. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEnvIDBytes() { - java.lang.Object ref = envID_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - envID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APPLICATIONIDENTIFIER_FIELD_NUMBER = 2; - private volatile java.lang.Object applicationIdentifier_; - /** - * string applicationIdentifier = 2; - * @return The applicationIdentifier. - */ - @java.lang.Override - public java.lang.String getApplicationIdentifier() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationIdentifier_ = s; - return s; - } - } - /** - * string applicationIdentifier = 2; - * @return The bytes for applicationIdentifier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationIdentifierBytes() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEYTYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object keyType_; - /** - * string keyType = 3; - * @return The keyType. - */ - @java.lang.Override - public java.lang.String getKeyType() { - java.lang.Object ref = keyType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyType_ = s; - return s; - } - } - /** - * string keyType = 3; - * @return The bytes for keyType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyTypeBytes() { - java.lang.Object ref = keyType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - keyType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getEnvIDBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, envID_); - } - if (!getApplicationIdentifierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, applicationIdentifier_); - } - if (!getKeyTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, keyType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getEnvIDBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, envID_); - } - if (!getApplicationIdentifierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, applicationIdentifier_); - } - if (!getKeyTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, keyType_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.Environment)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.Environment other = (org.wso2.apk.enforcer.discovery.subscription.Environment) obj; - - if (!getEnvID() - .equals(other.getEnvID())) return false; - if (!getApplicationIdentifier() - .equals(other.getApplicationIdentifier())) return false; - if (!getKeyType() - .equals(other.getKeyType())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENVID_FIELD_NUMBER; - hash = (53 * hash) + getEnvID().hashCode(); - hash = (37 * hash) + APPLICATIONIDENTIFIER_FIELD_NUMBER; - hash = (53 * hash) + getApplicationIdentifier().hashCode(); - hash = (37 * hash) + KEYTYPE_FIELD_NUMBER; - hash = (53 * hash) + getKeyType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.Environment prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.Environment} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.Environment) - org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Environment.class, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.Environment.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - envID_ = ""; - - applicationIdentifier_ = ""; - - keyType_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.Environment.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment build() { - org.wso2.apk.enforcer.discovery.subscription.Environment result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.Environment result = new org.wso2.apk.enforcer.discovery.subscription.Environment(this); - result.envID_ = envID_; - result.applicationIdentifier_ = applicationIdentifier_; - result.keyType_ = keyType_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.Environment) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.Environment)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.Environment other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.Environment.getDefaultInstance()) return this; - if (!other.getEnvID().isEmpty()) { - envID_ = other.envID_; - onChanged(); - } - if (!other.getApplicationIdentifier().isEmpty()) { - applicationIdentifier_ = other.applicationIdentifier_; - onChanged(); - } - if (!other.getKeyType().isEmpty()) { - keyType_ = other.keyType_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.Environment parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.Environment) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object envID_ = ""; - /** - * string envID = 1; - * @return The envID. - */ - public java.lang.String getEnvID() { - java.lang.Object ref = envID_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - envID_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string envID = 1; - * @return The bytes for envID. - */ - public com.google.protobuf.ByteString - getEnvIDBytes() { - java.lang.Object ref = envID_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - envID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string envID = 1; - * @param value The envID to set. - * @return This builder for chaining. - */ - public Builder setEnvID( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - envID_ = value; - onChanged(); - return this; - } - /** - * string envID = 1; - * @return This builder for chaining. - */ - public Builder clearEnvID() { - - envID_ = getDefaultInstance().getEnvID(); - onChanged(); - return this; - } - /** - * string envID = 1; - * @param value The bytes for envID to set. - * @return This builder for chaining. - */ - public Builder setEnvIDBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - envID_ = value; - onChanged(); - return this; - } - - private java.lang.Object applicationIdentifier_ = ""; - /** - * string applicationIdentifier = 2; - * @return The applicationIdentifier. - */ - public java.lang.String getApplicationIdentifier() { - java.lang.Object ref = applicationIdentifier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationIdentifier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string applicationIdentifier = 2; - * @return The bytes for applicationIdentifier. - */ - public com.google.protobuf.ByteString - getApplicationIdentifierBytes() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string applicationIdentifier = 2; - * @param value The applicationIdentifier to set. - * @return This builder for chaining. - */ - public Builder setApplicationIdentifier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - applicationIdentifier_ = value; - onChanged(); - return this; - } - /** - * string applicationIdentifier = 2; - * @return This builder for chaining. - */ - public Builder clearApplicationIdentifier() { - - applicationIdentifier_ = getDefaultInstance().getApplicationIdentifier(); - onChanged(); - return this; - } - /** - * string applicationIdentifier = 2; - * @param value The bytes for applicationIdentifier to set. - * @return This builder for chaining. - */ - public Builder setApplicationIdentifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - applicationIdentifier_ = value; - onChanged(); - return this; - } - - private java.lang.Object keyType_ = ""; - /** - * string keyType = 3; - * @return The keyType. - */ - public java.lang.String getKeyType() { - java.lang.Object ref = keyType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string keyType = 3; - * @return The bytes for keyType. - */ - public com.google.protobuf.ByteString - getKeyTypeBytes() { - java.lang.Object ref = keyType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - keyType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string keyType = 3; - * @param value The keyType to set. - * @return This builder for chaining. - */ - public Builder setKeyType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - keyType_ = value; - onChanged(); - return this; - } - /** - * string keyType = 3; - * @return This builder for chaining. - */ - public Builder clearKeyType() { - - keyType_ = getDefaultInstance().getKeyType(); - onChanged(); - return this; - } - /** - * string keyType = 3; - * @param value The bytes for keyType to set. - * @return This builder for chaining. - */ - public Builder setKeyTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - keyType_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.Environment) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.Environment) - private static final org.wso2.apk.enforcer.discovery.subscription.Environment DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.Environment(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.Environment getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Environment parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Environment(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EnvironmentOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EnvironmentOrBuilder.java deleted file mode 100644 index 97f621f50..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EnvironmentOrBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface EnvironmentOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.Environment) - com.google.protobuf.MessageOrBuilder { - - /** - * string envID = 1; - * @return The envID. - */ - java.lang.String getEnvID(); - /** - * string envID = 1; - * @return The bytes for envID. - */ - com.google.protobuf.ByteString - getEnvIDBytes(); - - /** - * string applicationIdentifier = 2; - * @return The applicationIdentifier. - */ - java.lang.String getApplicationIdentifier(); - /** - * string applicationIdentifier = 2; - * @return The bytes for applicationIdentifier. - */ - com.google.protobuf.ByteString - getApplicationIdentifierBytes(); - - /** - * string keyType = 3; - * @return The keyType. - */ - java.lang.String getKeyType(); - /** - * string keyType = 3; - * @return The bytes for keyType. - */ - com.google.protobuf.ByteString - getKeyTypeBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2.java deleted file mode 100644 index 5e40ba2b2..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2.java +++ /dev/null @@ -1,770 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.OAuth2} - */ -public final class OAuth2 extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.OAuth2) - OAuth2OrBuilder { -private static final long serialVersionUID = 0L; - // Use OAuth2.newBuilder() to construct. - private OAuth2(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OAuth2() { - environments_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OAuth2(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OAuth2( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - environments_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - environments_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Environment.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - environments_ = java.util.Collections.unmodifiableList(environments_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.OAuth2.class, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder.class); - } - - public static final int ENVIRONMENTS_FIELD_NUMBER = 1; - private java.util.List environments_; - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public java.util.List getEnvironmentsList() { - return environments_; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public java.util.List - getEnvironmentsOrBuilderList() { - return environments_; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public int getEnvironmentsCount() { - return environments_.size(); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment getEnvironments(int index) { - return environments_.get(index); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder getEnvironmentsOrBuilder( - int index) { - return environments_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < environments_.size(); i++) { - output.writeMessage(1, environments_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < environments_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, environments_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.OAuth2)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.OAuth2 other = (org.wso2.apk.enforcer.discovery.subscription.OAuth2) obj; - - if (!getEnvironmentsList() - .equals(other.getEnvironmentsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getEnvironmentsCount() > 0) { - hash = (37 * hash) + ENVIRONMENTS_FIELD_NUMBER; - hash = (53 * hash) + getEnvironmentsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.OAuth2 prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.OAuth2} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.OAuth2) - org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.OAuth2.class, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.OAuth2.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEnvironmentsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (environmentsBuilder_ == null) { - environments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - environmentsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 build() { - org.wso2.apk.enforcer.discovery.subscription.OAuth2 result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.OAuth2 result = new org.wso2.apk.enforcer.discovery.subscription.OAuth2(this); - int from_bitField0_ = bitField0_; - if (environmentsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - environments_ = java.util.Collections.unmodifiableList(environments_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.environments_ = environments_; - } else { - result.environments_ = environmentsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.OAuth2) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.OAuth2)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.OAuth2 other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance()) return this; - if (environmentsBuilder_ == null) { - if (!other.environments_.isEmpty()) { - if (environments_.isEmpty()) { - environments_ = other.environments_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEnvironmentsIsMutable(); - environments_.addAll(other.environments_); - } - onChanged(); - } - } else { - if (!other.environments_.isEmpty()) { - if (environmentsBuilder_.isEmpty()) { - environmentsBuilder_.dispose(); - environmentsBuilder_ = null; - environments_ = other.environments_; - bitField0_ = (bitField0_ & ~0x00000001); - environmentsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEnvironmentsFieldBuilder() : null; - } else { - environmentsBuilder_.addAllMessages(other.environments_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.OAuth2 parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.OAuth2) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List environments_ = - java.util.Collections.emptyList(); - private void ensureEnvironmentsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - environments_ = new java.util.ArrayList(environments_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Environment, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder, org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder> environmentsBuilder_; - - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public java.util.List getEnvironmentsList() { - if (environmentsBuilder_ == null) { - return java.util.Collections.unmodifiableList(environments_); - } else { - return environmentsBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public int getEnvironmentsCount() { - if (environmentsBuilder_ == null) { - return environments_.size(); - } else { - return environmentsBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.Environment getEnvironments(int index) { - if (environmentsBuilder_ == null) { - return environments_.get(index); - } else { - return environmentsBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder setEnvironments( - int index, org.wso2.apk.enforcer.discovery.subscription.Environment value) { - if (environmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvironmentsIsMutable(); - environments_.set(index, value); - onChanged(); - } else { - environmentsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder setEnvironments( - int index, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder builderForValue) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - environments_.set(index, builderForValue.build()); - onChanged(); - } else { - environmentsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addEnvironments(org.wso2.apk.enforcer.discovery.subscription.Environment value) { - if (environmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvironmentsIsMutable(); - environments_.add(value); - onChanged(); - } else { - environmentsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addEnvironments( - int index, org.wso2.apk.enforcer.discovery.subscription.Environment value) { - if (environmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvironmentsIsMutable(); - environments_.add(index, value); - onChanged(); - } else { - environmentsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addEnvironments( - org.wso2.apk.enforcer.discovery.subscription.Environment.Builder builderForValue) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - environments_.add(builderForValue.build()); - onChanged(); - } else { - environmentsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addEnvironments( - int index, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder builderForValue) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - environments_.add(index, builderForValue.build()); - onChanged(); - } else { - environmentsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addAllEnvironments( - java.lang.Iterable values) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, environments_); - onChanged(); - } else { - environmentsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder clearEnvironments() { - if (environmentsBuilder_ == null) { - environments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - environmentsBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder removeEnvironments(int index) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - environments_.remove(index); - onChanged(); - } else { - environmentsBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.Environment.Builder getEnvironmentsBuilder( - int index) { - return getEnvironmentsFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder getEnvironmentsOrBuilder( - int index) { - if (environmentsBuilder_ == null) { - return environments_.get(index); } else { - return environmentsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public java.util.List - getEnvironmentsOrBuilderList() { - if (environmentsBuilder_ != null) { - return environmentsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(environments_); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.Environment.Builder addEnvironmentsBuilder() { - return getEnvironmentsFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.Environment.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.Environment.Builder addEnvironmentsBuilder( - int index) { - return getEnvironmentsFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.Environment.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public java.util.List - getEnvironmentsBuilderList() { - return getEnvironmentsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Environment, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder, org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder> - getEnvironmentsFieldBuilder() { - if (environmentsBuilder_ == null) { - environmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Environment, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder, org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder>( - environments_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - environments_ = null; - } - return environmentsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.OAuth2) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.OAuth2) - private static final org.wso2.apk.enforcer.discovery.subscription.OAuth2 DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.OAuth2(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OAuth2 parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OAuth2(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2OrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2OrBuilder.java deleted file mode 100644 index 186f562e2..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2OrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface OAuth2OrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.OAuth2) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - java.util.List - getEnvironmentsList(); - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - org.wso2.apk.enforcer.discovery.subscription.Environment getEnvironments(int index); - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - int getEnvironmentsCount(); - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - java.util.List - getEnvironmentsOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder getEnvironmentsOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemes.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemes.java deleted file mode 100644 index 6653eb815..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemes.java +++ /dev/null @@ -1,607 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.SecuritySchemes} - */ -public final class SecuritySchemes extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SecuritySchemes) - SecuritySchemesOrBuilder { -private static final long serialVersionUID = 0L; - // Use SecuritySchemes.newBuilder() to construct. - private SecuritySchemes(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SecuritySchemes() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SecuritySchemes(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SecuritySchemes( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder subBuilder = null; - if (oAuth2_ != null) { - subBuilder = oAuth2_.toBuilder(); - } - oAuth2_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.OAuth2.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(oAuth2_); - oAuth2_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.class, org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.Builder.class); - } - - public static final int OAUTH2_FIELD_NUMBER = 1; - private org.wso2.apk.enforcer.discovery.subscription.OAuth2 oAuth2_; - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return Whether the oAuth2 field is set. - */ - @java.lang.Override - public boolean hasOAuth2() { - return oAuth2_ != null; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return The oAuth2. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 getOAuth2() { - return oAuth2_ == null ? org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance() : oAuth2_; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder getOAuth2OrBuilder() { - return getOAuth2(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (oAuth2_ != null) { - output.writeMessage(1, getOAuth2()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (oAuth2_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getOAuth2()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes other = (org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes) obj; - - if (hasOAuth2() != other.hasOAuth2()) return false; - if (hasOAuth2()) { - if (!getOAuth2() - .equals(other.getOAuth2())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasOAuth2()) { - hash = (37 * hash) + OAUTH2_FIELD_NUMBER; - hash = (53 * hash) + getOAuth2().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.SecuritySchemes} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SecuritySchemes) - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.class, org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (oAuth2Builder_ == null) { - oAuth2_ = null; - } else { - oAuth2_ = null; - oAuth2Builder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes build() { - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes result = new org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes(this); - if (oAuth2Builder_ == null) { - result.oAuth2_ = oAuth2_; - } else { - result.oAuth2_ = oAuth2Builder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.getDefaultInstance()) return this; - if (other.hasOAuth2()) { - mergeOAuth2(other.getOAuth2()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.wso2.apk.enforcer.discovery.subscription.OAuth2 oAuth2_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.OAuth2, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder, org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder> oAuth2Builder_; - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return Whether the oAuth2 field is set. - */ - public boolean hasOAuth2() { - return oAuth2Builder_ != null || oAuth2_ != null; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return The oAuth2. - */ - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 getOAuth2() { - if (oAuth2Builder_ == null) { - return oAuth2_ == null ? org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance() : oAuth2_; - } else { - return oAuth2Builder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public Builder setOAuth2(org.wso2.apk.enforcer.discovery.subscription.OAuth2 value) { - if (oAuth2Builder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - oAuth2_ = value; - onChanged(); - } else { - oAuth2Builder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public Builder setOAuth2( - org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder builderForValue) { - if (oAuth2Builder_ == null) { - oAuth2_ = builderForValue.build(); - onChanged(); - } else { - oAuth2Builder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public Builder mergeOAuth2(org.wso2.apk.enforcer.discovery.subscription.OAuth2 value) { - if (oAuth2Builder_ == null) { - if (oAuth2_ != null) { - oAuth2_ = - org.wso2.apk.enforcer.discovery.subscription.OAuth2.newBuilder(oAuth2_).mergeFrom(value).buildPartial(); - } else { - oAuth2_ = value; - } - onChanged(); - } else { - oAuth2Builder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public Builder clearOAuth2() { - if (oAuth2Builder_ == null) { - oAuth2_ = null; - onChanged(); - } else { - oAuth2_ = null; - oAuth2Builder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder getOAuth2Builder() { - - onChanged(); - return getOAuth2FieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder getOAuth2OrBuilder() { - if (oAuth2Builder_ != null) { - return oAuth2Builder_.getMessageOrBuilder(); - } else { - return oAuth2_ == null ? - org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance() : oAuth2_; - } - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.OAuth2, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder, org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder> - getOAuth2FieldBuilder() { - if (oAuth2Builder_ == null) { - oAuth2Builder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.OAuth2, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder, org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder>( - getOAuth2(), - getParentForChildren(), - isClean()); - oAuth2_ = null; - } - return oAuth2Builder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SecuritySchemes) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SecuritySchemes) - private static final org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SecuritySchemes parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SecuritySchemes(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemesOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemesOrBuilder.java deleted file mode 100644 index 2c568b7ce..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemesOrBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SecuritySchemesOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SecuritySchemes) - com.google.protobuf.MessageOrBuilder { - - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return Whether the oAuth2 field is set. - */ - boolean hasOAuth2(); - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return The oAuth2. - */ - org.wso2.apk.enforcer.discovery.subscription.OAuth2 getOAuth2(); - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder getOAuth2OrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionList.java deleted file mode 100644 index 96c2b94bc..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * SubscriptionList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionList} - */ -public final class SubscriptionList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SubscriptionList) - SubscriptionListOrBuilder { -private static final long serialVersionUID = 0L; - // Use SubscriptionList.newBuilder() to construct. - private SubscriptionList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SubscriptionList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SubscriptionList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SubscriptionList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Subscription.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Subscription getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList other = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SubscriptionList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * SubscriptionList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SubscriptionList) - org.wso2.apk.enforcer.discovery.subscription.SubscriptionListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionList build() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList result = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SubscriptionList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SubscriptionList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.Subscription value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.Subscription value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.Subscription value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SubscriptionList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SubscriptionList) - private static final org.wso2.apk.enforcer.discovery.subscription.SubscriptionList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SubscriptionList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SubscriptionList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListOrBuilder.java deleted file mode 100644 index 111fcc514..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SubscriptionListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SubscriptionList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.Subscription getList(int index); - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListProto.java deleted file mode 100644 index ee1a7a7a1..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListProto.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class SubscriptionListProto { - private SubscriptionListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_SubscriptionList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_SubscriptionList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n3wso2/discovery/subscription/subscripti" + - "on_list.proto\022\033wso2.discovery.subscripti" + - "on\032.wso2/discovery/subscription/subscrip" + - "tion.proto\"K\n\020SubscriptionList\0227\n\004list\030\002" + - " \003(\0132).wso2.discovery.subscription.Subsc" + - "riptionB\230\001\n,org.wso2.apk.enforcer.discov" + - "ery.subscriptionB\025SubscriptionListProtoP" + - "\001ZOgithub.com/envoyproxy/go-control-plan" + - "e/wso2/discovery/subscription;subscripti" + - "onb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_SubscriptionList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_SubscriptionList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_SubscriptionList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicy.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicy.java deleted file mode 100644 index e08ae8e06..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicy.java +++ /dev/null @@ -1,1429 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * SubscriptionPolicy data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionPolicy} - */ -public final class SubscriptionPolicy extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SubscriptionPolicy) - SubscriptionPolicyOrBuilder { -private static final long serialVersionUID = 0L; - // Use SubscriptionPolicy.newBuilder() to construct. - private SubscriptionPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SubscriptionPolicy() { - name_ = ""; - quotaType_ = ""; - rateLimitTimeUnit_ = ""; - tenantDomain_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SubscriptionPolicy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SubscriptionPolicy( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - id_ = input.readInt32(); - break; - } - case 16: { - - tenantId_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - quotaType_ = s; - break; - } - case 40: { - - graphQLMaxComplexity_ = input.readInt32(); - break; - } - case 48: { - - graphQLMaxDepth_ = input.readInt32(); - break; - } - case 56: { - - rateLimitCount_ = input.readInt32(); - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - rateLimitTimeUnit_ = s; - break; - } - case 72: { - - stopOnQuotaReach_ = input.readBool(); - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - - tenantDomain_ = s; - break; - } - case 88: { - - timestamp_ = input.readInt64(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private int id_; - /** - * int32 id = 1; - * @return The id. - */ - @java.lang.Override - public int getId() { - return id_; - } - - public static final int TENANTID_FIELD_NUMBER = 2; - private int tenantId_; - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - @java.lang.Override - public int getTenantId() { - return tenantId_; - } - - public static final int NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object name_; - /** - * string name = 3; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 3; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int QUOTATYPE_FIELD_NUMBER = 4; - private volatile java.lang.Object quotaType_; - /** - * string quotaType = 4; - * @return The quotaType. - */ - @java.lang.Override - public java.lang.String getQuotaType() { - java.lang.Object ref = quotaType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - quotaType_ = s; - return s; - } - } - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getQuotaTypeBytes() { - java.lang.Object ref = quotaType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - quotaType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GRAPHQLMAXCOMPLEXITY_FIELD_NUMBER = 5; - private int graphQLMaxComplexity_; - /** - * int32 graphQLMaxComplexity = 5; - * @return The graphQLMaxComplexity. - */ - @java.lang.Override - public int getGraphQLMaxComplexity() { - return graphQLMaxComplexity_; - } - - public static final int GRAPHQLMAXDEPTH_FIELD_NUMBER = 6; - private int graphQLMaxDepth_; - /** - * int32 graphQLMaxDepth = 6; - * @return The graphQLMaxDepth. - */ - @java.lang.Override - public int getGraphQLMaxDepth() { - return graphQLMaxDepth_; - } - - public static final int RATELIMITCOUNT_FIELD_NUMBER = 7; - private int rateLimitCount_; - /** - * int32 rateLimitCount = 7; - * @return The rateLimitCount. - */ - @java.lang.Override - public int getRateLimitCount() { - return rateLimitCount_; - } - - public static final int RATELIMITTIMEUNIT_FIELD_NUMBER = 8; - private volatile java.lang.Object rateLimitTimeUnit_; - /** - * string rateLimitTimeUnit = 8; - * @return The rateLimitTimeUnit. - */ - @java.lang.Override - public java.lang.String getRateLimitTimeUnit() { - java.lang.Object ref = rateLimitTimeUnit_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rateLimitTimeUnit_ = s; - return s; - } - } - /** - * string rateLimitTimeUnit = 8; - * @return The bytes for rateLimitTimeUnit. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRateLimitTimeUnitBytes() { - java.lang.Object ref = rateLimitTimeUnit_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - rateLimitTimeUnit_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STOPONQUOTAREACH_FIELD_NUMBER = 9; - private boolean stopOnQuotaReach_; - /** - * bool stopOnQuotaReach = 9; - * @return The stopOnQuotaReach. - */ - @java.lang.Override - public boolean getStopOnQuotaReach() { - return stopOnQuotaReach_; - } - - public static final int TENANTDOMAIN_FIELD_NUMBER = 10; - private volatile java.lang.Object tenantDomain_; - /** - * string tenantDomain = 10; - * @return The tenantDomain. - */ - @java.lang.Override - public java.lang.String getTenantDomain() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tenantDomain_ = s; - return s; - } - } - /** - * string tenantDomain = 10; - * @return The bytes for tenantDomain. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTenantDomainBytes() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tenantDomain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 11; - private long timestamp_; - /** - * int64 timestamp = 11; - * @return The timestamp. - */ - @java.lang.Override - public long getTimestamp() { - return timestamp_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0) { - output.writeInt32(1, id_); - } - if (tenantId_ != 0) { - output.writeInt32(2, tenantId_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); - } - if (!getQuotaTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, quotaType_); - } - if (graphQLMaxComplexity_ != 0) { - output.writeInt32(5, graphQLMaxComplexity_); - } - if (graphQLMaxDepth_ != 0) { - output.writeInt32(6, graphQLMaxDepth_); - } - if (rateLimitCount_ != 0) { - output.writeInt32(7, rateLimitCount_); - } - if (!getRateLimitTimeUnitBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, rateLimitTimeUnit_); - } - if (stopOnQuotaReach_ != false) { - output.writeBool(9, stopOnQuotaReach_); - } - if (!getTenantDomainBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, tenantDomain_); - } - if (timestamp_ != 0L) { - output.writeInt64(11, timestamp_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, id_); - } - if (tenantId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, tenantId_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); - } - if (!getQuotaTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, quotaType_); - } - if (graphQLMaxComplexity_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, graphQLMaxComplexity_); - } - if (graphQLMaxDepth_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, graphQLMaxDepth_); - } - if (rateLimitCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, rateLimitCount_); - } - if (!getRateLimitTimeUnitBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, rateLimitTimeUnit_); - } - if (stopOnQuotaReach_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(9, stopOnQuotaReach_); - } - if (!getTenantDomainBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, tenantDomain_); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(11, timestamp_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy other = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy) obj; - - if (getId() - != other.getId()) return false; - if (getTenantId() - != other.getTenantId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getQuotaType() - .equals(other.getQuotaType())) return false; - if (getGraphQLMaxComplexity() - != other.getGraphQLMaxComplexity()) return false; - if (getGraphQLMaxDepth() - != other.getGraphQLMaxDepth()) return false; - if (getRateLimitCount() - != other.getRateLimitCount()) return false; - if (!getRateLimitTimeUnit() - .equals(other.getRateLimitTimeUnit())) return false; - if (getStopOnQuotaReach() - != other.getStopOnQuotaReach()) return false; - if (!getTenantDomain() - .equals(other.getTenantDomain())) return false; - if (getTimestamp() - != other.getTimestamp()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId(); - hash = (37 * hash) + TENANTID_FIELD_NUMBER; - hash = (53 * hash) + getTenantId(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + QUOTATYPE_FIELD_NUMBER; - hash = (53 * hash) + getQuotaType().hashCode(); - hash = (37 * hash) + GRAPHQLMAXCOMPLEXITY_FIELD_NUMBER; - hash = (53 * hash) + getGraphQLMaxComplexity(); - hash = (37 * hash) + GRAPHQLMAXDEPTH_FIELD_NUMBER; - hash = (53 * hash) + getGraphQLMaxDepth(); - hash = (37 * hash) + RATELIMITCOUNT_FIELD_NUMBER; - hash = (53 * hash) + getRateLimitCount(); - hash = (37 * hash) + RATELIMITTIMEUNIT_FIELD_NUMBER; - hash = (53 * hash) + getRateLimitTimeUnit().hashCode(); - hash = (37 * hash) + STOPONQUOTAREACH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getStopOnQuotaReach()); - hash = (37 * hash) + TENANTDOMAIN_FIELD_NUMBER; - hash = (53 * hash) + getTenantDomain().hashCode(); - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimestamp()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * SubscriptionPolicy data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionPolicy} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SubscriptionPolicy) - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0; - - tenantId_ = 0; - - name_ = ""; - - quotaType_ = ""; - - graphQLMaxComplexity_ = 0; - - graphQLMaxDepth_ = 0; - - rateLimitCount_ = 0; - - rateLimitTimeUnit_ = ""; - - stopOnQuotaReach_ = false; - - tenantDomain_ = ""; - - timestamp_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy build() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy result = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy(this); - result.id_ = id_; - result.tenantId_ = tenantId_; - result.name_ = name_; - result.quotaType_ = quotaType_; - result.graphQLMaxComplexity_ = graphQLMaxComplexity_; - result.graphQLMaxDepth_ = graphQLMaxDepth_; - result.rateLimitCount_ = rateLimitCount_; - result.rateLimitTimeUnit_ = rateLimitTimeUnit_; - result.stopOnQuotaReach_ = stopOnQuotaReach_; - result.tenantDomain_ = tenantDomain_; - result.timestamp_ = timestamp_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.getDefaultInstance()) return this; - if (other.getId() != 0) { - setId(other.getId()); - } - if (other.getTenantId() != 0) { - setTenantId(other.getTenantId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getQuotaType().isEmpty()) { - quotaType_ = other.quotaType_; - onChanged(); - } - if (other.getGraphQLMaxComplexity() != 0) { - setGraphQLMaxComplexity(other.getGraphQLMaxComplexity()); - } - if (other.getGraphQLMaxDepth() != 0) { - setGraphQLMaxDepth(other.getGraphQLMaxDepth()); - } - if (other.getRateLimitCount() != 0) { - setRateLimitCount(other.getRateLimitCount()); - } - if (!other.getRateLimitTimeUnit().isEmpty()) { - rateLimitTimeUnit_ = other.rateLimitTimeUnit_; - onChanged(); - } - if (other.getStopOnQuotaReach() != false) { - setStopOnQuotaReach(other.getStopOnQuotaReach()); - } - if (!other.getTenantDomain().isEmpty()) { - tenantDomain_ = other.tenantDomain_; - onChanged(); - } - if (other.getTimestamp() != 0L) { - setTimestamp(other.getTimestamp()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int id_ ; - /** - * int32 id = 1; - * @return The id. - */ - @java.lang.Override - public int getId() { - return id_; - } - /** - * int32 id = 1; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(int value) { - - id_ = value; - onChanged(); - return this; - } - /** - * int32 id = 1; - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = 0; - onChanged(); - return this; - } - - private int tenantId_ ; - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - @java.lang.Override - public int getTenantId() { - return tenantId_; - } - /** - * int32 tenantId = 2; - * @param value The tenantId to set. - * @return This builder for chaining. - */ - public Builder setTenantId(int value) { - - tenantId_ = value; - onChanged(); - return this; - } - /** - * int32 tenantId = 2; - * @return This builder for chaining. - */ - public Builder clearTenantId() { - - tenantId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 3; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 3; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 3; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 3; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 3; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object quotaType_ = ""; - /** - * string quotaType = 4; - * @return The quotaType. - */ - public java.lang.String getQuotaType() { - java.lang.Object ref = quotaType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - quotaType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - public com.google.protobuf.ByteString - getQuotaTypeBytes() { - java.lang.Object ref = quotaType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - quotaType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string quotaType = 4; - * @param value The quotaType to set. - * @return This builder for chaining. - */ - public Builder setQuotaType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - quotaType_ = value; - onChanged(); - return this; - } - /** - * string quotaType = 4; - * @return This builder for chaining. - */ - public Builder clearQuotaType() { - - quotaType_ = getDefaultInstance().getQuotaType(); - onChanged(); - return this; - } - /** - * string quotaType = 4; - * @param value The bytes for quotaType to set. - * @return This builder for chaining. - */ - public Builder setQuotaTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - quotaType_ = value; - onChanged(); - return this; - } - - private int graphQLMaxComplexity_ ; - /** - * int32 graphQLMaxComplexity = 5; - * @return The graphQLMaxComplexity. - */ - @java.lang.Override - public int getGraphQLMaxComplexity() { - return graphQLMaxComplexity_; - } - /** - * int32 graphQLMaxComplexity = 5; - * @param value The graphQLMaxComplexity to set. - * @return This builder for chaining. - */ - public Builder setGraphQLMaxComplexity(int value) { - - graphQLMaxComplexity_ = value; - onChanged(); - return this; - } - /** - * int32 graphQLMaxComplexity = 5; - * @return This builder for chaining. - */ - public Builder clearGraphQLMaxComplexity() { - - graphQLMaxComplexity_ = 0; - onChanged(); - return this; - } - - private int graphQLMaxDepth_ ; - /** - * int32 graphQLMaxDepth = 6; - * @return The graphQLMaxDepth. - */ - @java.lang.Override - public int getGraphQLMaxDepth() { - return graphQLMaxDepth_; - } - /** - * int32 graphQLMaxDepth = 6; - * @param value The graphQLMaxDepth to set. - * @return This builder for chaining. - */ - public Builder setGraphQLMaxDepth(int value) { - - graphQLMaxDepth_ = value; - onChanged(); - return this; - } - /** - * int32 graphQLMaxDepth = 6; - * @return This builder for chaining. - */ - public Builder clearGraphQLMaxDepth() { - - graphQLMaxDepth_ = 0; - onChanged(); - return this; - } - - private int rateLimitCount_ ; - /** - * int32 rateLimitCount = 7; - * @return The rateLimitCount. - */ - @java.lang.Override - public int getRateLimitCount() { - return rateLimitCount_; - } - /** - * int32 rateLimitCount = 7; - * @param value The rateLimitCount to set. - * @return This builder for chaining. - */ - public Builder setRateLimitCount(int value) { - - rateLimitCount_ = value; - onChanged(); - return this; - } - /** - * int32 rateLimitCount = 7; - * @return This builder for chaining. - */ - public Builder clearRateLimitCount() { - - rateLimitCount_ = 0; - onChanged(); - return this; - } - - private java.lang.Object rateLimitTimeUnit_ = ""; - /** - * string rateLimitTimeUnit = 8; - * @return The rateLimitTimeUnit. - */ - public java.lang.String getRateLimitTimeUnit() { - java.lang.Object ref = rateLimitTimeUnit_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rateLimitTimeUnit_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string rateLimitTimeUnit = 8; - * @return The bytes for rateLimitTimeUnit. - */ - public com.google.protobuf.ByteString - getRateLimitTimeUnitBytes() { - java.lang.Object ref = rateLimitTimeUnit_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - rateLimitTimeUnit_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string rateLimitTimeUnit = 8; - * @param value The rateLimitTimeUnit to set. - * @return This builder for chaining. - */ - public Builder setRateLimitTimeUnit( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - rateLimitTimeUnit_ = value; - onChanged(); - return this; - } - /** - * string rateLimitTimeUnit = 8; - * @return This builder for chaining. - */ - public Builder clearRateLimitTimeUnit() { - - rateLimitTimeUnit_ = getDefaultInstance().getRateLimitTimeUnit(); - onChanged(); - return this; - } - /** - * string rateLimitTimeUnit = 8; - * @param value The bytes for rateLimitTimeUnit to set. - * @return This builder for chaining. - */ - public Builder setRateLimitTimeUnitBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - rateLimitTimeUnit_ = value; - onChanged(); - return this; - } - - private boolean stopOnQuotaReach_ ; - /** - * bool stopOnQuotaReach = 9; - * @return The stopOnQuotaReach. - */ - @java.lang.Override - public boolean getStopOnQuotaReach() { - return stopOnQuotaReach_; - } - /** - * bool stopOnQuotaReach = 9; - * @param value The stopOnQuotaReach to set. - * @return This builder for chaining. - */ - public Builder setStopOnQuotaReach(boolean value) { - - stopOnQuotaReach_ = value; - onChanged(); - return this; - } - /** - * bool stopOnQuotaReach = 9; - * @return This builder for chaining. - */ - public Builder clearStopOnQuotaReach() { - - stopOnQuotaReach_ = false; - onChanged(); - return this; - } - - private java.lang.Object tenantDomain_ = ""; - /** - * string tenantDomain = 10; - * @return The tenantDomain. - */ - public java.lang.String getTenantDomain() { - java.lang.Object ref = tenantDomain_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tenantDomain_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string tenantDomain = 10; - * @return The bytes for tenantDomain. - */ - public com.google.protobuf.ByteString - getTenantDomainBytes() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tenantDomain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string tenantDomain = 10; - * @param value The tenantDomain to set. - * @return This builder for chaining. - */ - public Builder setTenantDomain( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tenantDomain_ = value; - onChanged(); - return this; - } - /** - * string tenantDomain = 10; - * @return This builder for chaining. - */ - public Builder clearTenantDomain() { - - tenantDomain_ = getDefaultInstance().getTenantDomain(); - onChanged(); - return this; - } - /** - * string tenantDomain = 10; - * @param value The bytes for tenantDomain to set. - * @return This builder for chaining. - */ - public Builder setTenantDomainBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tenantDomain_ = value; - onChanged(); - return this; - } - - private long timestamp_ ; - /** - * int64 timestamp = 11; - * @return The timestamp. - */ - @java.lang.Override - public long getTimestamp() { - return timestamp_; - } - /** - * int64 timestamp = 11; - * @param value The timestamp to set. - * @return This builder for chaining. - */ - public Builder setTimestamp(long value) { - - timestamp_ = value; - onChanged(); - return this; - } - /** - * int64 timestamp = 11; - * @return This builder for chaining. - */ - public Builder clearTimestamp() { - - timestamp_ = 0L; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SubscriptionPolicy) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SubscriptionPolicy) - private static final org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SubscriptionPolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SubscriptionPolicy(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyList.java deleted file mode 100644 index bcddf227c..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * SubscriptionPolicyList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionPolicyList} - */ -public final class SubscriptionPolicyList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SubscriptionPolicyList) - SubscriptionPolicyListOrBuilder { -private static final long serialVersionUID = 0L; - // Use SubscriptionPolicyList.newBuilder() to construct. - private SubscriptionPolicyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SubscriptionPolicyList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SubscriptionPolicyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SubscriptionPolicyList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList other = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * SubscriptionPolicyList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionPolicyList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SubscriptionPolicyList) - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList build() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList result = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SubscriptionPolicyList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SubscriptionPolicyList) - private static final org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SubscriptionPolicyList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SubscriptionPolicyList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListOrBuilder.java deleted file mode 100644 index 6340a52d5..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SubscriptionPolicyListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SubscriptionPolicyList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getList(int index); - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListProto.java deleted file mode 100644 index c5d1304c3..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListProto.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class SubscriptionPolicyListProto { - private SubscriptionPolicyListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n:wso2/discovery/subscription/subscripti" + - "on_policy_list.proto\022\033wso2.discovery.sub" + - "scription\0325wso2/discovery/subscription/s" + - "ubscription_policy.proto\"W\n\026Subscription" + - "PolicyList\022=\n\004list\030\002 \003(\0132/.wso2.discover" + - "y.subscription.SubscriptionPolicyB\236\001\n,or" + - "g.wso2.apk.enforcer.discovery.subscripti" + - "onB\033SubscriptionPolicyListProtoP\001ZOgithu" + - "b.com/envoyproxy/go-control-plane/wso2/d" + - "iscovery/subscription;subscriptionb\006prot" + - "o3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyOrBuilder.java deleted file mode 100644 index 68b563f5f..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyOrBuilder.java +++ /dev/null @@ -1,99 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SubscriptionPolicyOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SubscriptionPolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 id = 1; - * @return The id. - */ - int getId(); - - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - int getTenantId(); - - /** - * string name = 3; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 3; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string quotaType = 4; - * @return The quotaType. - */ - java.lang.String getQuotaType(); - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - com.google.protobuf.ByteString - getQuotaTypeBytes(); - - /** - * int32 graphQLMaxComplexity = 5; - * @return The graphQLMaxComplexity. - */ - int getGraphQLMaxComplexity(); - - /** - * int32 graphQLMaxDepth = 6; - * @return The graphQLMaxDepth. - */ - int getGraphQLMaxDepth(); - - /** - * int32 rateLimitCount = 7; - * @return The rateLimitCount. - */ - int getRateLimitCount(); - - /** - * string rateLimitTimeUnit = 8; - * @return The rateLimitTimeUnit. - */ - java.lang.String getRateLimitTimeUnit(); - /** - * string rateLimitTimeUnit = 8; - * @return The bytes for rateLimitTimeUnit. - */ - com.google.protobuf.ByteString - getRateLimitTimeUnitBytes(); - - /** - * bool stopOnQuotaReach = 9; - * @return The stopOnQuotaReach. - */ - boolean getStopOnQuotaReach(); - - /** - * string tenantDomain = 10; - * @return The tenantDomain. - */ - java.lang.String getTenantDomain(); - /** - * string tenantDomain = 10; - * @return The bytes for tenantDomain. - */ - com.google.protobuf.ByteString - getTenantDomainBytes(); - - /** - * int64 timestamp = 11; - * @return The timestamp. - */ - long getTimestamp(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyProto.java deleted file mode 100644 index db9ded6e6..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyProto.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class SubscriptionPolicyProto { - private SubscriptionPolicyProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_SubscriptionPolicy_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n5wso2/discovery/subscription/subscripti" + - "on_policy.proto\022\033wso2.discovery.subscrip" + - "tion\"\200\002\n\022SubscriptionPolicy\022\n\n\002id\030\001 \001(\005\022" + - "\020\n\010tenantId\030\002 \001(\005\022\014\n\004name\030\003 \001(\t\022\021\n\tquota" + - "Type\030\004 \001(\t\022\034\n\024graphQLMaxComplexity\030\005 \001(\005" + - "\022\027\n\017graphQLMaxDepth\030\006 \001(\005\022\026\n\016rateLimitCo" + - "unt\030\007 \001(\005\022\031\n\021rateLimitTimeUnit\030\010 \001(\t\022\030\n\020" + - "stopOnQuotaReach\030\t \001(\010\022\024\n\014tenantDomain\030\n" + - " \001(\t\022\021\n\ttimestamp\030\013 \001(\003B\232\001\n,org.wso2.apk" + - ".enforcer.discovery.subscriptionB\027Subscr" + - "iptionPolicyProtoP\001ZOgithub.com/envoypro" + - "xy/go-control-plane/wso2/discovery/subsc" + - "ription;subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_SubscriptionPolicy_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor, - new java.lang.String[] { "Id", "TenantId", "Name", "QuotaType", "GraphQLMaxComplexity", "GraphQLMaxDepth", "RateLimitCount", "RateLimitTimeUnit", "StopOnQuotaReach", "TenantDomain", "Timestamp", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java index 030d301c2..ab472da4f 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java @@ -31,6 +31,34 @@ public class Application implements CacheableEntity { private String uuid; private String name = null; private String owner = null; + + public void setAttributes(Map attributes) { + + this.attributes = attributes; + } + + public String getOrganization() { + + return organization; + } + + public void setOrganization(String organization) { + + this.organization = organization; + } + + private String organization = null; + + public String getUuid() { + + return uuid; + } + + public void setUuid(String uuid) { + + this.uuid = uuid; + } + private Map attributes = new ConcurrentHashMap<>(); public String getUUID() { diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java index ba5282a7a..8a05a7d2e 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java @@ -29,6 +29,15 @@ public class SubscribedAPI { private String name = null; private String version = null; + public SubscribedAPI(org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI subscribedApi) { + this.name = subscribedApi.getName(); + this.version = subscribedApi.getVersion(); + } + + public SubscribedAPI() { + + } + public String getName() { return name; } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java index b471cfeb6..cf5878f1f 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java @@ -20,7 +20,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.RevokedTokenDiscoveryClient; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -35,8 +34,6 @@ public class RevokedJWTDataHolder { private static RevokedJWTDataHolder instance = new RevokedJWTDataHolder(); public void init() { - RevokedTokenDiscoveryClient revokedTokenDs = RevokedTokenDiscoveryClient.getInstance(); - revokedTokenDs.watchRevokedTokens(); } /** diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java new file mode 100644 index 000000000..0cded32cd --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java @@ -0,0 +1,172 @@ +package org.wso2.apk.enforcer.subscription; +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) 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. + */ + +import io.grpc.ClientInterceptor; +import io.grpc.ConnectivityState; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.stub.MetadataUtils; +import io.grpc.stub.StreamObserver; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.wso2.apk.enforcer.config.ConfigHolder; +import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; +import org.wso2.apk.enforcer.discovery.service.subscription.EventStreamServiceGrpc; +import org.wso2.apk.enforcer.discovery.service.subscription.Request; +import org.wso2.apk.enforcer.discovery.subscription.Application; +import org.wso2.apk.enforcer.discovery.subscription.Event; +import org.wso2.apk.enforcer.util.GRPCUtils; + +import java.util.UUID; +import java.util.concurrent.TimeUnit; + +/** + * Client to communicate with JWTIssuer discovery service at the adapter. + */ +public class EventingGrpcClient implements Runnable { + + private static final Logger logger = LogManager.getLogger(EventingGrpcClient.class); + private static EventingGrpcClient instance; + private ManagedChannel channel; + private EventStreamServiceGrpc.EventStreamServiceStub stub; + private final SubscriptionDataStoreImpl subscriptionDataStore; + private final String host; + private final String hostname; + private final int port; + + private EventingGrpcClient(String host, String hostname, int port) { + + this.host = host; + this.hostname = hostname; + this.port = port; + this.subscriptionDataStore = SubscriptionDataStoreImpl.getInstance(); + initConnection(); + } + + private void initConnection() { + + if (GRPCUtils.isReInitRequired(channel)) { + if (channel != null && !channel.isShutdown()) { + channel.shutdownNow(); + do { + try { + channel.awaitTermination(100, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + logger.error("JWTISsuer discovery channel shutdown wait was interrupted", e); + } + } while (!channel.isShutdown()); + } + Metadata metadata = new Metadata(); + String connectionId = UUID.randomUUID().toString(); + metadata.put(Metadata.Key.of("enforcer-uuid", Metadata.ASCII_STRING_MARSHALLER), + connectionId); + logger.info("Enforcer UUID: " + connectionId); + this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); + ClientInterceptor metadataInterceptor = MetadataUtils.newAttachHeadersInterceptor(metadata); + + this.stub = EventStreamServiceGrpc.newStub(channel).withInterceptors(metadataInterceptor); + } else if (channel.getState(true) == ConnectivityState.READY) { + XdsSchedulerManager.getInstance().stopEventStreamScheduling(); + } + } + + public static EventingGrpcClient getInstance() { + + if (instance == null) { + String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); + String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); + int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerXdsPort()); + instance = new EventingGrpcClient(sdsHost, sdsHostname, sdsPort); + } + return instance; + } + + public void run() { + + initConnection(); + watchEvents(); + } + + public void watchEvents() { + + Request request = Request.newBuilder().setEvent("event").build(); + + stub.streamEvents(request, new StreamObserver() { + @Override + public void onNext(Event event) { + handleNotificationEvent(event); + XdsSchedulerManager.getInstance().stopEventStreamScheduling(); + } + + @Override + public void onError(Throwable t) { + + logger.error("Event error", t); + XdsSchedulerManager.getInstance().startEventScheduling(); + + } + + @Override + public void onCompleted() { + + logger.info("Completed===="); + } + }); + } + private void handleNotificationEvent(Event event) { + + switch (event.getType()) { + case "ALL_EVENTS": + subscriptionDataStore.loadStartupArtifacts(); + case "APPLICATION_CREATED": + Application application = event.getApplication(); + subscriptionDataStore.addApplication(application); + break; + case "SUBSCRIPTION_CREATED": + case "SUBSCRIPTION_UPDATED": + subscriptionDataStore.addSubscription(event.getSubscription()); + break; + case "APPLICATION_MAPPING_CREATED": + case "APPLICATION_MAPPING_UPDATED": + subscriptionDataStore.addApplicationMapping(event.getApplicationMapping()); + break; + case "APPLICATION_KEY_MAPPING_CREATED": + case "APPLICATION_KEY_MAPPING_UPDATED": + subscriptionDataStore.addApplicationKeyMapping(event.getApplicationKeyMapping()); + break; + case "APPLICATION_UPDATED": + subscriptionDataStore.addApplication(event.getApplication()); + break; + case "APPLICATION_MAPPING_DELETED": + subscriptionDataStore.removeApplicationMapping(event.getApplicationMapping()); + break; + case "APPLICATION_KEY_MAPPING_DELETED": + subscriptionDataStore.removeApplicationKeyMapping(event.getApplicationKeyMapping()); + break; + case "SUBSCRIPTION_DELETED": + subscriptionDataStore.removeSubscription(event.getSubscription()); + break; + case "APPLICATION_DELETED": + subscriptionDataStore.removeApplication(event.getApplication()); + break; + default: + logger.error("Unknown event type received from the server"); + } + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java index 18fe03df2..bee48039f 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java @@ -90,7 +90,7 @@ void addApplicationKeyMappings( * @return ApplicationKeyMapping which match the given parameters */ ApplicationKeyMapping getMatchingApplicationKeyMapping(String applicationIdentifier, String keyType, - String securityScheme); + String securityScheme); /** * Filter the applications map based on the provided parameters. @@ -112,9 +112,28 @@ ApplicationKeyMapping getMatchingApplicationKeyMapping(String applicationIdentif /** * Returns the JWTValidator based on Issuer - * @param issuer issuer in JWT + * + * @param issuer issuer in JWT * @param environment environment of the Issuer * @return JWTValidator Implementation */ JWTValidator getJWTValidatorByIssuer(String issuer, String organization, String environment); + + void addApplication(org.wso2.apk.enforcer.discovery.subscription.Application application); + + void addSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription); + + void addApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping); + + void addApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping); + + void removeApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping); + + void removeApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping); + + void removeSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription); + + void removeApplication(org.wso2.apk.enforcer.discovery.subscription.Application application); + + void loadStartupArtifacts(); } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java index 7b17e2b6e..edbd7d6b5 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java @@ -52,6 +52,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -127,15 +128,14 @@ public Subscription getSubscriptionById(String appId, String apiId) { } private void initializeLoadingTasks() { - loadSubscriptions(); - loadApplications(); - loadApplicationMappings(); - loadApplicationKeyMappings(); + ApiListDiscoveryClient.getInstance().watchApiList(); JWTIssuerDiscoveryClient.getInstance().watchJWTIssuers(); + EventingGrpcClient.getInstance().watchEvents(); } private void loadApplicationKeyMappings() { + new Thread(() -> { ApplicationKeyMappingDtoList applicationKeyMappings = subscriptionValidationDataRetrievalRestClient.getAllApplicationKeyMappings(); @@ -145,6 +145,7 @@ private void loadApplicationKeyMappings() { } private void loadApplicationMappings() { + new Thread(() -> { ApplicationMappingDtoList applicationMappings = subscriptionValidationDataRetrievalRestClient .getAllApplicationMappings(); @@ -153,12 +154,14 @@ private void loadApplicationMappings() { } - private void loadApplications(){ + private void loadApplications() { + new Thread(() -> { ApplicationListDto applications = subscriptionValidationDataRetrievalRestClient.getAllApplications(); addApplications(applications.getList()); }).start(); } + private void loadSubscriptions() { new Thread(() -> { @@ -194,7 +197,7 @@ public void addApplications(List applicationList) { Map newApplicationMap = new ConcurrentHashMap<>(); - for (ApplicationDto application: applicationList) { + for (ApplicationDto application : applicationList) { Application newApplication = new Application(); newApplication.setUUID(application.getUuid()); newApplication.setName(application.getName()); @@ -429,6 +432,129 @@ public JWTValidator getJWTValidatorByIssuer(String issuer, String organization, return null; } + @Override + public void addApplication(org.wso2.apk.enforcer.discovery.subscription.Application application) { + + Application resolvedApplication = new Application(); + resolvedApplication.setName(application.getName()); + resolvedApplication.setOwner(application.getOwner()); + resolvedApplication.setUUID(application.getUuid()); + resolvedApplication.setOrganization(application.getOrganization()); + resolvedApplication.setAttributes(application.getAttributesMap()); + if (applicationMap.containsKey(resolvedApplication.getUuid())) { + applicationMap.replace(resolvedApplication.getUuid(), resolvedApplication); + } else { + applicationMap.put(resolvedApplication.getUuid(), resolvedApplication); + } + } + + @Override + public void addSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription) { + + Subscription resolvedSubscription = new Subscription(); + resolvedSubscription.setSubscriptionId(subscription.getUuid()); + resolvedSubscription.setSubscriptionStatus(subscription.getSubStatus()); + resolvedSubscription.setOrganization(subscription.getOrganization()); + resolvedSubscription.setSubscribedApi(new SubscribedAPI(subscription.getSubscribedApi())); + if (subscriptionMap.containsKey(resolvedSubscription.getSubscriptionId())) { + subscriptionMap.replace(resolvedSubscription.getSubscriptionId(), resolvedSubscription); + } else { + subscriptionMap.put(resolvedSubscription.getSubscriptionId(), resolvedSubscription); + } + } + + @Override + public void addApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping) { + + ApplicationMapping resolvedApplicationMapping = new ApplicationMapping(); + resolvedApplicationMapping.setUuid(applicationMapping.getUuid()); + resolvedApplicationMapping.setApplicationRef(applicationMapping.getApplicationRef()); + resolvedApplicationMapping.setSubscriptionRef(applicationMapping.getSubscriptionRef()); + if (applicationMappingMap.containsKey(resolvedApplicationMapping.getUuid())) { + applicationMappingMap.replace(resolvedApplicationMapping.getUuid(), resolvedApplicationMapping); + } else { + applicationMappingMap.put(resolvedApplicationMapping.getUuid(), resolvedApplicationMapping); + } + } + + @Override + public void addApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping) { + + ApplicationKeyMapping resolvedApplicationKeyMapping = new ApplicationKeyMapping(); + resolvedApplicationKeyMapping.setApplicationUUID(applicationKeyMapping.getApplicationUUID()); + resolvedApplicationKeyMapping.setSecurityScheme(applicationKeyMapping.getSecurityScheme()); + resolvedApplicationKeyMapping.setApplicationIdentifier(applicationKeyMapping.getApplicationIdentifier()); + resolvedApplicationKeyMapping.setKeyType(applicationKeyMapping.getKeyType()); + resolvedApplicationKeyMapping.setEnvId(applicationKeyMapping.getEnvID()); + Iterator> iterator = applicationKeyMappingMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry cachedApplicationKeyMapping = iterator.next(); + ApplicationKeyMapping value = cachedApplicationKeyMapping.getValue(); + if (value.getApplicationIdentifier().equals(resolvedApplicationKeyMapping.getApplicationIdentifier()) && + value.getSecurityScheme().equals(resolvedApplicationKeyMapping.getSecurityScheme()) && + value.getKeyType().equals(resolvedApplicationKeyMapping.getKeyType()) && + value.getEnvId().equals(resolvedApplicationKeyMapping.getEnvId()) && + value.getApplicationUUID().equals(resolvedApplicationKeyMapping.getApplicationUUID())) { + iterator.remove(); + } + } + applicationKeyMappingMap.put(resolvedApplicationKeyMapping.getCacheKey(), resolvedApplicationKeyMapping); + } + + @Override + public void removeApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping) { + + ApplicationMapping resolvedApplicationMapping = new ApplicationMapping(); + resolvedApplicationMapping.setUuid(applicationMapping.getUuid()); + resolvedApplicationMapping.setApplicationRef(applicationMapping.getApplicationRef()); + resolvedApplicationMapping.setSubscriptionRef(applicationMapping.getSubscriptionRef()); + applicationMappingMap.remove(resolvedApplicationMapping.getUuid()); + } + + @Override + public void removeApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping) { + + ApplicationKeyMapping resolvedApplicationKeyMapping = new ApplicationKeyMapping(); + resolvedApplicationKeyMapping.setApplicationUUID(applicationKeyMapping.getApplicationUUID()); + resolvedApplicationKeyMapping.setSecurityScheme(applicationKeyMapping.getSecurityScheme()); + resolvedApplicationKeyMapping.setApplicationIdentifier(applicationKeyMapping.getApplicationIdentifier()); + resolvedApplicationKeyMapping.setKeyType(applicationKeyMapping.getKeyType()); + resolvedApplicationKeyMapping.setEnvId(applicationKeyMapping.getEnvID()); + Iterator> iterator = applicationKeyMappingMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry cachedApplicationKeyMapping = iterator.next(); + ApplicationKeyMapping value = cachedApplicationKeyMapping.getValue(); + if (value.getApplicationIdentifier().equals(resolvedApplicationKeyMapping.getApplicationIdentifier()) && + value.getSecurityScheme().equals(resolvedApplicationKeyMapping.getSecurityScheme()) && + value.getKeyType().equals(resolvedApplicationKeyMapping.getKeyType()) && + value.getEnvId().equals(resolvedApplicationKeyMapping.getEnvId()) && + value.getApplicationUUID().equals(resolvedApplicationKeyMapping.getApplicationUUID())) { + iterator.remove(); + } + } + } + + @Override + public void removeSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription) { + + subscriptionMap.remove(subscription.getUuid()); + } + + @Override + public void removeApplication(org.wso2.apk.enforcer.discovery.subscription.Application application) { + + applicationMap.remove(application.getUuid()); + } + + @Override + public void loadStartupArtifacts() { + + loadSubscriptions(); + loadApplications(); + loadApplicationMappings(); + loadApplicationKeyMappings(); + } + private List getEnvironments(JWTIssuer jwtIssuer) { List environmentsList = new ArrayList<>(); diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java index 373f3ed29..a7ec36f00 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java @@ -19,7 +19,11 @@ package org.wso2.apk.enforcer.util; import io.grpc.ConnectivityState; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; @@ -37,6 +41,7 @@ public class GRPCUtils { public static ManagedChannel createSecuredChannel(Logger logger, String host, int port, String hostname) { + File certFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()).toFile(); File keyFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()).toFile(); SslContext sslContext = null; @@ -57,6 +62,7 @@ public static ManagedChannel createSecuredChannel(Logger logger, String host, in } public static boolean isReInitRequired(ManagedChannel channel) { + if (channel != null && (channel.getState(true) == ConnectivityState.CONNECTING || channel.getState(true) == ConnectivityState.READY)) { return false; diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java index 4a98930c0..62ff2a676 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java @@ -36,6 +36,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; @@ -51,6 +52,7 @@ * Utility Functions related to TLS Certificates. */ public class TLSUtils { + private static final Logger log = LogManager.getLogger(TLSUtils.class); private static final String X509 = "X.509"; private static final String crtExtension = ".crt"; @@ -65,6 +67,7 @@ public class TLSUtils { */ public static Certificate getCertificateFromFile(String filePath) throws CertificateException, IOException, EnforcerException { + return getCertsFromFile(filePath, true).get(0); } @@ -90,6 +93,7 @@ public static Certificate getCertificateFromString(String certificateContent) * @param trustStore Keystore with trusted certificates */ public static void addCertsToTruststore(KeyStore trustStore, String filePath) throws IOException { + if (!Files.exists(Paths.get(filePath))) { log.error("The provided certificates directory/file path does not exist. : " + filePath); return; @@ -110,6 +114,7 @@ public static void addCertsToTruststore(KeyStore trustStore, String filePath) th } public static void convertAndAddCertificatesToTrustStore(KeyStore trustStore, List certificates) { + for (Certificate certificate : certificates) { try { trustStore.setCertificateEntry(RandomStringUtils.random(10, true, false), @@ -122,6 +127,7 @@ public static void convertAndAddCertificatesToTrustStore(KeyStore trustStore, Li private static List getCertsFromFile(String filepath, boolean restrictToOne) throws CertificateException, IOException, EnforcerException { + String content = new String(Files.readAllBytes(Paths.get(filepath))); if (!content.contains(endCertificateDelimiter)) { @@ -154,6 +160,7 @@ private static List getCertsFromFile(String filepath, boolean restr } private static void updateTruststoreWithMultipleCertPem(KeyStore trustStore, String filePath) { + try { List certificateList = getCertsFromFile(filePath, false); certificateList.forEach(certificate -> { @@ -171,6 +178,7 @@ private static void updateTruststoreWithMultipleCertPem(KeyStore trustStore, Str } public static Certificate getCertificate(String filePath) throws CertificateException, IOException { + try (FileInputStream fileInputStream = new FileInputStream(filePath)) { String content = IOUtils.toString(fileInputStream); return getCertificateFromContent(content); @@ -178,6 +186,7 @@ public static Certificate getCertificate(String filePath) throws CertificateExce } public static Certificate getCertificateFromContent(String content) throws CertificateException, IOException { + CertificateFactory fact = CertificateFactory.getInstance(X509); try (InputStream is = new ByteArrayInputStream(content.getBytes())) { X509Certificate cert = (X509Certificate) fact.generateCertificate(is); @@ -192,6 +201,7 @@ public static Certificate getCertificateFromContent(String content) throws Certi * @throws SSLException */ public static SslContext buildGRPCServerSSLContext() throws SSLException { + File certFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()).toFile(); File keyFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()).toFile(); @@ -202,6 +212,7 @@ public static SslContext buildGRPCServerSSLContext() throws SSLException { } public static KeyStore getDefaultCertTrustStore() throws EnforcerException { + try { KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); @@ -215,6 +226,7 @@ public static KeyStore getDefaultCertTrustStore() throws EnforcerException { public static void loadDefaultCertsToTrustStore(KeyStore trustStore) throws NoSuchAlgorithmException, KeyStoreException { + TrustManagerFactory tmf = TrustManagerFactory .getInstance(TrustManagerFactory.getDefaultAlgorithm()); // Using null here initialises the TMF with the default trust store. @@ -243,4 +255,20 @@ public static void loadDefaultCertsToTrustStore(KeyStore trustStore) throws }); } } + + public static KeyStore getKeyStore(String certPath, String keyPath) { + KeyStore keyStore = null; + try { + Certificate cert = + TLSUtils.getCertificateFromFile(certPath); + Key key = JWTUtils.getPrivateKey(keyPath); + keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, null); + keyStore.setKeyEntry("client-keys", key, null, new Certificate[]{cert}); + } catch (EnforcerException | CertificateException | IOException | KeyStoreException | + NoSuchAlgorithmException e) { + log.error("Error occurred while configuring KeyStore", e); + } + return keyStore; + } } diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml index 0426ebc38..7d1d0640f 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml @@ -109,7 +109,8 @@ spec: - name: enforcer_admin_pwd value: admin - name: JAVA_OPTS - value: -Dhttpclient.hostnameVerifier=AllowAll -Xms512m -Xmx512m -XX:MaxRAMFraction=2 + # value: -Dhttpclient.hostnameVerifier=AllowAll -Xms512m -Xmx512m -XX:MaxRAMFraction=2 + value: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5006 -Dhttpclient.hostnameVerifier=AllowAll -Xms512m -Xmx512m -XX:MaxRAMFraction=2 {{- if .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.redis }} - name: REDIS_USERNAME value: {{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.redis.username | default "default" }} diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 41fd0df10..9cb46b7b2 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -212,8 +212,8 @@ wso2: failureThreshold: 5 strategy: RollingUpdate replicas: 1 - imagePullPolicy: Always - image: wso2/apk-adapter:latest + imagePullPolicy: IfNotPresent + image: apk-adapter:1.0.0-SNAPSHOT security: sslHostname: "adapter" # logging: