From c67f41c8732b9d75668c22af9a6f66e258fb922c Mon Sep 17 00:00:00 2001 From: tharindu1st Date: Thu, 4 Jan 2024 14:29:28 +0530 Subject: [PATCH] move subs protos --- adapter/go.mod | 2 + adapter/go.sum | 2 - .../discovery/protocol/cache/v3/resource.go | 4 - .../commoncontroller/common_controller.go | 2 +- common-controller/go.mod | 4 +- common-controller/go.sum | 2 - .../internal/server/event_server.go | 2 +- .../utils/enforcer_connection_holder.go | 2 +- .../internal/utils/event_utils.go | 4 +- .../discovery/service/apkmgt/eventds.pb.go | 16 +- .../discovery/subscription/application.pb.go | 13 +- .../application_key_mapping.pb.go | 13 +- .../subscription/applicationmapping.pb.go | 14 +- .../wso2/discovery/subscription/event.pb.go | 13 +- .../discovery/subscription/subscription.pb.go | 13 +- .../discovery/service/apkmgt/eventds.pb.go | 278 ++++++++++++++++++ .../discovery/subscription/application.pb.go | 219 ++++++++++++++ .../application_key_mapping.pb.go | 235 +++++++++++++++ .../subscription/applicationmapping.pb.go | 203 +++++++++++++ .../wso2/discovery/subscription/event.pb.go | 268 +++++++++++++++++ .../discovery/subscription/subscription.pb.go | 277 +++++++++++++++++ .../utils/enforcer_connection_holder.go | 22 -- .../service/apkmgt/EventServiceProto.java | 8 +- .../ApplicationKeyMappingProto.java | 8 +- .../subscription/ApplicationMappingProto.java | 8 +- .../subscription/ApplicationProto.java | 9 +- .../discovery/subscription/EventProto.java | 8 +- .../subscription/SubscriptionProto.java | 8 +- .../org/wso2/apk/enforcer/util/GRPCUtils.java | 1 - protos/protogen.sh | 82 ++++++ .../discovery/service/apkmgt/eventds.proto | 18 ++ .../discovery/subscription/application.proto | 35 +++ .../application_key_mapping.proto | 37 +++ .../subscription/applicationmapping.proto | 34 +++ .../wso2/discovery/subscription/event.proto | 42 +++ .../discovery/subscription/subscription.proto | 39 +++ 36 files changed, 1845 insertions(+), 100 deletions(-) rename {adapter => common-controller}/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go (94%) rename {adapter => common-controller}/pkg/discovery/api/wso2/discovery/subscription/application.pb.go (94%) rename {adapter => common-controller}/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go (95%) rename {adapter => common-controller}/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go (93%) rename {adapter => common-controller}/pkg/discovery/api/wso2/discovery/subscription/event.pb.go (96%) rename {adapter => common-controller}/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go (95%) create mode 100644 common-go-libs/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go create mode 100644 common-go-libs/pkg/discovery/api/wso2/discovery/subscription/application.pb.go create mode 100644 common-go-libs/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go create mode 100644 common-go-libs/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go create mode 100644 common-go-libs/pkg/discovery/api/wso2/discovery/subscription/event.pb.go create mode 100644 common-go-libs/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go delete mode 100644 common-go-libs/utils/enforcer_connection_holder.go create mode 100755 protos/protogen.sh create mode 100644 protos/wso2/discovery/service/apkmgt/eventds.proto create mode 100644 protos/wso2/discovery/subscription/application.proto create mode 100644 protos/wso2/discovery/subscription/application_key_mapping.proto create mode 100644 protos/wso2/discovery/subscription/applicationmapping.proto create mode 100644 protos/wso2/discovery/subscription/event.proto create mode 100644 protos/wso2/discovery/subscription/subscription.proto diff --git a/adapter/go.mod b/adapter/go.mod index 795e2f808..3ef2c7d98 100644 --- a/adapter/go.mod +++ b/adapter/go.mod @@ -88,6 +88,8 @@ require ( replace github.com/wso2/apk/adapter => ../adapter +replace github.com/wso2/apk/common-go-libs => ../common-go-libs + require ( github.com/getkin/kin-openapi v0.107.0 github.com/ghodss/yaml v1.0.0 diff --git a/adapter/go.sum b/adapter/go.sum index 438e9279b..a45b991ba 100644 --- a/adapter/go.sum +++ b/adapter/go.sum @@ -170,8 +170,6 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/wso2/apk/common-go-libs v0.0.0-20231208100153-24bee7b4bd81 h1:Iobh0zi81XVNjC8dCckNWvr5VkpDwHlbJWq5jmOZtww= -github.com/wso2/apk/common-go-libs v0.0.0-20231208100153-24bee7b4bd81/go.mod h1:fvkFU/8JJpx4Pem9srTjWmD3c89AKsyRpLyNPdQriDc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= diff --git a/adapter/pkg/discovery/protocol/cache/v3/resource.go b/adapter/pkg/discovery/protocol/cache/v3/resource.go index d786b5ad0..e74624120 100644 --- a/adapter/pkg/discovery/protocol/cache/v3/resource.go +++ b/adapter/pkg/discovery/protocol/cache/v3/resource.go @@ -78,10 +78,6 @@ func GetResourceName(res envoy_types.Resource) string { return "Config" case *subscription.JWTIssuerList: return "JWTIssuer" - case *subscription.Application: - return fmt.Sprint(v.Uuid) - case *subscription.Subscription: - return fmt.Sprint(v.Uuid) case *subscription.JWTIssuer: return fmt.Sprint(v.Name) default: diff --git a/common-controller/commoncontroller/common_controller.go b/common-controller/commoncontroller/common_controller.go index 1093b4c22..ea071545c 100644 --- a/common-controller/commoncontroller/common_controller.go +++ b/common-controller/commoncontroller/common_controller.go @@ -31,7 +31,6 @@ 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" - 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" @@ -41,6 +40,7 @@ import ( "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" + apkmgt "github.com/wso2/apk/common-go-libs/pkg/discovery/api/wso2/discovery/service/apkmgt" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/keepalive" diff --git a/common-controller/go.mod b/common-controller/go.mod index d08ce164d..7745b34aa 100644 --- a/common-controller/go.mod +++ b/common-controller/go.mod @@ -24,6 +24,8 @@ require ( replace github.com/wso2/apk/adapter => ../adapter +replace github.com/wso2/apk/common-go-libs => ../common-go-libs + require ( github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect @@ -100,7 +102,7 @@ require ( google.golang.org/genproto v0.0.0-20230731193218-e0aa005b6bdf // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.31.0 gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/common-controller/go.sum b/common-controller/go.sum index a8b34b25b..c0777538e 100644 --- a/common-controller/go.sum +++ b/common-controller/go.sum @@ -192,8 +192,6 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/wso2/apk/common-go-libs v0.0.0-20231208100153-24bee7b4bd81 h1:Iobh0zi81XVNjC8dCckNWvr5VkpDwHlbJWq5jmOZtww= -github.com/wso2/apk/common-go-libs v0.0.0-20231208100153-24bee7b4bd81/go.mod h1:fvkFU/8JJpx4Pem9srTjWmD3c89AKsyRpLyNPdQriDc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= diff --git a/common-controller/internal/server/event_server.go b/common-controller/internal/server/event_server.go index 79cfbda95..de6773957 100644 --- a/common-controller/internal/server/event_server.go +++ b/common-controller/internal/server/event_server.go @@ -1,9 +1,9 @@ package server import ( - 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" + apkmgt "github.com/wso2/apk/common-go-libs/pkg/discovery/api/wso2/discovery/service/apkmgt" "google.golang.org/grpc/metadata" ) diff --git a/common-controller/internal/utils/enforcer_connection_holder.go b/common-controller/internal/utils/enforcer_connection_holder.go index 6db90a035..2ee9823ac 100644 --- a/common-controller/internal/utils/enforcer_connection_holder.go +++ b/common-controller/internal/utils/enforcer_connection_holder.go @@ -1,7 +1,7 @@ package utils import ( - apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" + apkmgt "github.com/wso2/apk/common-go-libs/pkg/discovery/api/wso2/discovery/service/apkmgt" ) var clientConnections = make(map[string]apkmgt.EventStreamService_StreamEventsServer) diff --git a/common-controller/internal/utils/event_utils.go b/common-controller/internal/utils/event_utils.go index bdc68be02..de350566d 100644 --- a/common-controller/internal/utils/event_utils.go +++ b/common-controller/internal/utils/event_utils.go @@ -4,11 +4,11 @@ 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" constants "github.com/wso2/apk/common-controller/internal/operator/constant" cpv1alpha2 "github.com/wso2/apk/common-go-libs/apis/cp/v1alpha2" + apkmgt "github.com/wso2/apk/common-go-libs/pkg/discovery/api/wso2/discovery/service/apkmgt" + "github.com/wso2/apk/common-go-libs/pkg/discovery/api/wso2/discovery/subscription" ) // SendAppDeletionEvent sends an application creation event to the enforcer diff --git a/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go b/common-controller/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go similarity index 94% rename from adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go rename to common-controller/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go index 44197804a..20b1b3ffc 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go +++ b/common-controller/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go @@ -8,7 +8,7 @@ package apkmgt import ( context "context" - subscription "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" + subscription "github.com/wso2/apk/common-go-libs/pkg/discovery/api/wso2/discovery/subscription" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -91,17 +91,17 @@ var file_wso2_discovery_service_apkmgt_eventds_proto_rawDesc = []byte{ 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, + 0x30, 0x01, 0x42, 0x9c, 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, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 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, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, 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 ( diff --git a/adapter/pkg/discovery/api/wso2/discovery/subscription/application.pb.go b/common-controller/pkg/discovery/api/wso2/discovery/subscription/application.pb.go similarity index 94% rename from adapter/pkg/discovery/api/wso2/discovery/subscription/application.pb.go rename to common-controller/pkg/discovery/api/wso2/discovery/subscription/application.pb.go index e40dd74c2..678ce09cc 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/application.pb.go +++ b/common-controller/pkg/discovery/api/wso2/discovery/subscription/application.pb.go @@ -140,16 +140,17 @@ var file_wso2_discovery_subscription_application_proto_rawDesc = []byte{ 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, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 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, 0x10, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 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, + 0x6b, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, + 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.pb.go b/common-controller/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go similarity index 95% rename from adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go rename to common-controller/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go index 84cd52c21..89b5e9963 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go +++ b/common-controller/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go @@ -157,17 +157,18 @@ var file_wso2_discovery_subscription_application_key_mapping_proto_rawDesc = []b 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x97, 0x01, 0x0a, + 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 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, 0x49, 0x67, 0x69, 0x74, + 0x70, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 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, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, 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.pb.go b/common-controller/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go similarity index 93% rename from adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go rename to common-controller/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go index 3fc571044..2c5740ebd 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go +++ b/common-controller/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go @@ -126,17 +126,17 @@ var file_wso2_discovery_subscription_applicationmapping_proto_rawDesc = []byte{ 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 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, 0x42, 0x94, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x9b, 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, 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, + 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, + 0x32, 0x2f, 0x61, 0x70, 0x6b, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6c, 0x69, 0x62, 0x73, 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/event.pb.go b/common-controller/pkg/discovery/api/wso2/discovery/subscription/event.pb.go similarity index 96% rename from adapter/pkg/discovery/api/wso2/discovery/subscription/event.pb.go rename to common-controller/pkg/discovery/api/wso2/discovery/subscription/event.pb.go index bb97a44e6..74863d415 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/event.pb.go +++ b/common-controller/pkg/discovery/api/wso2/discovery/subscription/event.pb.go @@ -179,16 +179,17 @@ var file_wso2_discovery_subscription_event_proto_rawDesc = []byte{ 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, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 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, 0x0a, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, + 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 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, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, 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.pb.go b/common-controller/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go similarity index 95% rename from adapter/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go rename to common-controller/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go index a28d25531..078dbf67b 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go +++ b/common-controller/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go @@ -186,16 +186,17 @@ 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, 0x8e, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x95, 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, 0x49, 0x67, 0x69, 0x74, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 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, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, 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/common-go-libs/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go b/common-go-libs/pkg/discovery/api/wso2/discovery/service/apkmgt/eventds.pb.go new file mode 100644 index 000000000..20b1b3ffc --- /dev/null +++ b/common-go-libs/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/common-go-libs/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, 0x9c, 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, 0x52, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, 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/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/application.pb.go b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/application.pb.go new file mode 100644 index 000000000..678ce09cc --- /dev/null +++ b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/application.pb.go @@ -0,0 +1,219 @@ +// +// 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.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) +) + +// Application data model +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"` + 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() { + *x = Application{} + if protoimpl.UnsafeEnabled { + mi := &file_wso2_discovery_subscription_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_subscription_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_subscription_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) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *Application) GetAttributes() map[string]string { + if x != nil { + return x.Attributes + } + return nil +} + +var File_wso2_discovery_subscription_application_proto protoreflect.FileDescriptor + +var file_wso2_discovery_subscription_application_proto_rawDesc = []byte{ + 0x0a, 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, 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, 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, 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, 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, 0x10, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, + 0x6b, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, + 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_application_proto_rawDescOnce sync.Once + file_wso2_discovery_subscription_application_proto_rawDescData = file_wso2_discovery_subscription_application_proto_rawDesc +) + +func file_wso2_discovery_subscription_application_proto_rawDescGZIP() []byte { + file_wso2_discovery_subscription_application_proto_rawDescOnce.Do(func() { + file_wso2_discovery_subscription_application_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_application_proto_rawDescData) + }) + return file_wso2_discovery_subscription_application_proto_rawDescData +} + +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 + nil, // 1: wso2.discovery.subscription.Application.AttributesEntry +} +var file_wso2_discovery_subscription_application_proto_depIdxs = []int32{ + 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() } +func file_wso2_discovery_subscription_application_proto_init() { + if File_wso2_discovery_subscription_application_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_wso2_discovery_subscription_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 + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_wso2_discovery_subscription_application_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_wso2_discovery_subscription_application_proto_goTypes, + DependencyIndexes: file_wso2_discovery_subscription_application_proto_depIdxs, + MessageInfos: file_wso2_discovery_subscription_application_proto_msgTypes, + }.Build() + File_wso2_discovery_subscription_application_proto = out.File + file_wso2_discovery_subscription_application_proto_rawDesc = nil + file_wso2_discovery_subscription_application_proto_goTypes = nil + file_wso2_discovery_subscription_application_proto_depIdxs = nil +} diff --git a/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go new file mode 100644 index 000000000..89b5e9963 --- /dev/null +++ b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/application_key_mapping.pb.go @@ -0,0 +1,235 @@ +// +// 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.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) +) + +// ApplicationKeyMapping data model +type ApplicationKeyMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApplicationUUID string `protobuf:"bytes,1,opt,name=applicationUUID,proto3" json:"applicationUUID,omitempty"` + SecurityScheme string `protobuf:"bytes,2,opt,name=securityScheme,proto3" json:"securityScheme,omitempty"` + ApplicationIdentifier string `protobuf:"bytes,3,opt,name=applicationIdentifier,proto3" json:"applicationIdentifier,omitempty"` + KeyType string `protobuf:"bytes,4,opt,name=keyType,proto3" json:"keyType,omitempty"` + EnvID string `protobuf:"bytes,5,opt,name=envID,proto3" json:"envID,omitempty"` + Timestamp int64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Organization string `protobuf:"bytes,7,opt,name=organization,proto3" json:"organization,omitempty"` +} + +func (x *ApplicationKeyMapping) Reset() { + *x = ApplicationKeyMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_wso2_discovery_subscription_application_key_mapping_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplicationKeyMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplicationKeyMapping) ProtoMessage() {} + +func (x *ApplicationKeyMapping) ProtoReflect() protoreflect.Message { + mi := &file_wso2_discovery_subscription_application_key_mapping_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 ApplicationKeyMapping.ProtoReflect.Descriptor instead. +func (*ApplicationKeyMapping) Descriptor() ([]byte, []int) { + return file_wso2_discovery_subscription_application_key_mapping_proto_rawDescGZIP(), []int{0} +} + +func (x *ApplicationKeyMapping) GetApplicationUUID() string { + if x != nil { + return x.ApplicationUUID + } + return "" +} + +func (x *ApplicationKeyMapping) GetSecurityScheme() string { + if x != nil { + return x.SecurityScheme + } + return "" +} + +func (x *ApplicationKeyMapping) GetApplicationIdentifier() string { + if x != nil { + return x.ApplicationIdentifier + } + return "" +} + +func (x *ApplicationKeyMapping) GetKeyType() string { + if x != nil { + return x.KeyType + } + return "" +} + +func (x *ApplicationKeyMapping) GetEnvID() string { + if x != nil { + return x.EnvID + } + return "" +} + +func (x *ApplicationKeyMapping) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *ApplicationKeyMapping) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +var File_wso2_discovery_subscription_application_key_mapping_proto protoreflect.FileDescriptor + +var file_wso2_discovery_subscription_application_key_mapping_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, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 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, 0x91, 0x02, 0x0a, 0x15, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x55, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x55, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, + 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x65, 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, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, + 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, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, + 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 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, 0x50, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, 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_application_key_mapping_proto_rawDescOnce sync.Once + file_wso2_discovery_subscription_application_key_mapping_proto_rawDescData = file_wso2_discovery_subscription_application_key_mapping_proto_rawDesc +) + +func file_wso2_discovery_subscription_application_key_mapping_proto_rawDescGZIP() []byte { + file_wso2_discovery_subscription_application_key_mapping_proto_rawDescOnce.Do(func() { + file_wso2_discovery_subscription_application_key_mapping_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_application_key_mapping_proto_rawDescData) + }) + return file_wso2_discovery_subscription_application_key_mapping_proto_rawDescData +} + +var file_wso2_discovery_subscription_application_key_mapping_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_wso2_discovery_subscription_application_key_mapping_proto_goTypes = []interface{}{ + (*ApplicationKeyMapping)(nil), // 0: wso2.discovery.subscription.ApplicationKeyMapping +} +var file_wso2_discovery_subscription_application_key_mapping_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_key_mapping_proto_init() } +func file_wso2_discovery_subscription_application_key_mapping_proto_init() { + if File_wso2_discovery_subscription_application_key_mapping_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_wso2_discovery_subscription_application_key_mapping_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplicationKeyMapping); 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_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_wso2_discovery_subscription_application_key_mapping_proto_goTypes, + DependencyIndexes: file_wso2_discovery_subscription_application_key_mapping_proto_depIdxs, + MessageInfos: file_wso2_discovery_subscription_application_key_mapping_proto_msgTypes, + }.Build() + File_wso2_discovery_subscription_application_key_mapping_proto = out.File + file_wso2_discovery_subscription_application_key_mapping_proto_rawDesc = nil + file_wso2_discovery_subscription_application_key_mapping_proto_goTypes = nil + file_wso2_discovery_subscription_application_key_mapping_proto_depIdxs = nil +} diff --git a/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go new file mode 100644 index 000000000..2c5740ebd --- /dev/null +++ b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/applicationmapping.pb.go @@ -0,0 +1,203 @@ +// +// 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.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) +) + +// ApplicationMapping data model +type ApplicationMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + ApplicationRef string `protobuf:"bytes,2,opt,name=applicationRef,proto3" json:"applicationRef,omitempty"` + SubscriptionRef string `protobuf:"bytes,3,opt,name=subscriptionRef,proto3" json:"subscriptionRef,omitempty"` + Organization string `protobuf:"bytes,4,opt,name=organization,proto3" json:"organization,omitempty"` +} + +func (x *ApplicationMapping) Reset() { + *x = ApplicationMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_wso2_discovery_subscription_applicationmapping_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplicationMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplicationMapping) ProtoMessage() {} + +func (x *ApplicationMapping) ProtoReflect() protoreflect.Message { + mi := &file_wso2_discovery_subscription_applicationmapping_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 ApplicationMapping.ProtoReflect.Descriptor instead. +func (*ApplicationMapping) Descriptor() ([]byte, []int) { + return file_wso2_discovery_subscription_applicationmapping_proto_rawDescGZIP(), []int{0} +} + +func (x *ApplicationMapping) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *ApplicationMapping) GetApplicationRef() string { + if x != nil { + return x.ApplicationRef + } + return "" +} + +func (x *ApplicationMapping) GetSubscriptionRef() string { + if x != nil { + return x.SubscriptionRef + } + return "" +} + +func (x *ApplicationMapping) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +var File_wso2_discovery_subscription_applicationmapping_proto protoreflect.FileDescriptor + +var file_wso2_discovery_subscription_applicationmapping_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, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 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, 0x9e, 0x01, 0x0a, 0x12, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x26, + 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 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, + 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, 0x42, 0x9b, 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, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, + 0x32, 0x2f, 0x61, 0x70, 0x6b, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6c, 0x69, 0x62, 0x73, 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_applicationmapping_proto_rawDescOnce sync.Once + file_wso2_discovery_subscription_applicationmapping_proto_rawDescData = file_wso2_discovery_subscription_applicationmapping_proto_rawDesc +) + +func file_wso2_discovery_subscription_applicationmapping_proto_rawDescGZIP() []byte { + file_wso2_discovery_subscription_applicationmapping_proto_rawDescOnce.Do(func() { + file_wso2_discovery_subscription_applicationmapping_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_applicationmapping_proto_rawDescData) + }) + return file_wso2_discovery_subscription_applicationmapping_proto_rawDescData +} + +var file_wso2_discovery_subscription_applicationmapping_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_wso2_discovery_subscription_applicationmapping_proto_goTypes = []interface{}{ + (*ApplicationMapping)(nil), // 0: wso2.discovery.subscription.ApplicationMapping +} +var file_wso2_discovery_subscription_applicationmapping_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_applicationmapping_proto_init() } +func file_wso2_discovery_subscription_applicationmapping_proto_init() { + if File_wso2_discovery_subscription_applicationmapping_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_wso2_discovery_subscription_applicationmapping_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplicationMapping); 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_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_wso2_discovery_subscription_applicationmapping_proto_goTypes, + DependencyIndexes: file_wso2_discovery_subscription_applicationmapping_proto_depIdxs, + MessageInfos: file_wso2_discovery_subscription_applicationmapping_proto_msgTypes, + }.Build() + File_wso2_discovery_subscription_applicationmapping_proto = out.File + file_wso2_discovery_subscription_applicationmapping_proto_rawDesc = nil + file_wso2_discovery_subscription_applicationmapping_proto_goTypes = nil + file_wso2_discovery_subscription_applicationmapping_proto_depIdxs = nil +} diff --git a/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/event.pb.go b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/event.pb.go new file mode 100644 index 000000000..74863d415 --- /dev/null +++ b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/event.pb.go @@ -0,0 +1,268 @@ +// +// 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, 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, 0x0a, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, 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/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go new file mode 100644 index 000000000..078dbf67b --- /dev/null +++ b/common-go-libs/pkg/discovery/api/wso2/discovery/subscription/subscription.pb.go @@ -0,0 +1,277 @@ +// +// 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.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) +) + +// Subscription data model +type Subscription struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubStatus string `protobuf:"bytes,1,opt,name=subStatus,proto3" json:"subStatus,omitempty"` + Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` + Organization string `protobuf:"bytes,3,opt,name=organization,proto3" json:"organization,omitempty"` + SubscribedApi *SubscribedAPI `protobuf:"bytes,4,opt,name=subscribedApi,proto3" json:"subscribedApi,omitempty"` +} + +func (x *Subscription) Reset() { + *x = Subscription{} + if protoimpl.UnsafeEnabled { + mi := &file_wso2_discovery_subscription_subscription_proto_msgTypes[0] + 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_subscription_subscription_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 Subscription.ProtoReflect.Descriptor instead. +func (*Subscription) Descriptor() ([]byte, []int) { + return file_wso2_discovery_subscription_subscription_proto_rawDescGZIP(), []int{0} +} + +func (x *Subscription) GetSubStatus() string { + if x != nil { + return x.SubStatus + } + return "" +} + +func (x *Subscription) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *Subscription) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *Subscription) GetSubscribedApi() *SubscribedAPI { + if x != nil { + return x.SubscribedApi + } + return nil +} + +type SubscribedAPI struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *SubscribedAPI) Reset() { + *x = SubscribedAPI{} + if protoimpl.UnsafeEnabled { + mi := &file_wso2_discovery_subscription_subscription_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubscribedAPI) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribedAPI) ProtoMessage() {} + +func (x *SubscribedAPI) ProtoReflect() protoreflect.Message { + mi := &file_wso2_discovery_subscription_subscription_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 SubscribedAPI.ProtoReflect.Descriptor instead. +func (*SubscribedAPI) Descriptor() ([]byte, []int) { + return file_wso2_discovery_subscription_subscription_proto_rawDescGZIP(), []int{1} +} + +func (x *SubscribedAPI) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SubscribedAPI) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +var File_wso2_discovery_subscription_subscription_proto protoreflect.FileDescriptor + +var file_wso2_discovery_subscription_subscription_proto_rawDesc = []byte{ + 0x0a, 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, + 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, 0xb6, 0x01, + 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, + 0x0a, 0x09, 0x73, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, + 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x64, 0x41, 0x70, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 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, 0x62, 0x65, 0x64, 0x41, 0x50, 0x49, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x64, 0x41, 0x70, 0x69, 0x22, 0x3d, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 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, 0x95, 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, 0x50, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x61, 0x70, 0x6b, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6c, 0x69, 0x62, 0x73, 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_subscription_proto_rawDescOnce sync.Once + file_wso2_discovery_subscription_subscription_proto_rawDescData = file_wso2_discovery_subscription_subscription_proto_rawDesc +) + +func file_wso2_discovery_subscription_subscription_proto_rawDescGZIP() []byte { + file_wso2_discovery_subscription_subscription_proto_rawDescOnce.Do(func() { + file_wso2_discovery_subscription_subscription_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_subscription_subscription_proto_rawDescData) + }) + return file_wso2_discovery_subscription_subscription_proto_rawDescData +} + +var file_wso2_discovery_subscription_subscription_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_wso2_discovery_subscription_subscription_proto_goTypes = []interface{}{ + (*Subscription)(nil), // 0: wso2.discovery.subscription.Subscription + (*SubscribedAPI)(nil), // 1: wso2.discovery.subscription.SubscribedAPI +} +var file_wso2_discovery_subscription_subscription_proto_depIdxs = []int32{ + 1, // 0: wso2.discovery.subscription.Subscription.subscribedApi:type_name -> wso2.discovery.subscription.SubscribedAPI + 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_proto_init() } +func file_wso2_discovery_subscription_subscription_proto_init() { + if File_wso2_discovery_subscription_subscription_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_wso2_discovery_subscription_subscription_proto_msgTypes[0].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 + } + } + file_wso2_discovery_subscription_subscription_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubscribedAPI); 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_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_wso2_discovery_subscription_subscription_proto_goTypes, + DependencyIndexes: file_wso2_discovery_subscription_subscription_proto_depIdxs, + MessageInfos: file_wso2_discovery_subscription_subscription_proto_msgTypes, + }.Build() + File_wso2_discovery_subscription_subscription_proto = out.File + file_wso2_discovery_subscription_subscription_proto_rawDesc = nil + file_wso2_discovery_subscription_subscription_proto_goTypes = nil + file_wso2_discovery_subscription_subscription_proto_depIdxs = nil +} diff --git a/common-go-libs/utils/enforcer_connection_holder.go b/common-go-libs/utils/enforcer_connection_holder.go deleted file mode 100644 index 6db90a035..000000000 --- a/common-go-libs/utils/enforcer_connection_holder.go +++ /dev/null @@ -1,22 +0,0 @@ -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/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 index 2ebf3bdcc..8125f757a 100644 --- 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 @@ -34,11 +34,11 @@ public static void registerAllExtensions( "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" + + "n.Event\"\0000\001B\234\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" + "oP\001ZRgithub.com/wso2/apk/common-go-libs/" + + "pkg/discovery/api/wso2/discovery/service" + + "/apkmgt\210\001\001b\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/ApplicationKeyMappingProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingProto.java index db027867b..3091c2736 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(\003\022\024\n\014organization\030\007 \001(\tB\227\001\n,org.wso2" + + "\006 \001(\003\022\024\n\014organization\030\007 \001(\tB\236\001\n,org.wso2" + ".apk.enforcer.discovery.subscriptionB\032Ap" + - "plicationKeyMappingProtoP\001ZIgithub.com/w" + - "so2/apk/adapter/pkg/discovery/api/wso2/d" + - "iscovery/subscriptionb\006proto3" + "plicationKeyMappingProtoP\001ZPgithub.com/w" + + "so2/apk/common-go-libs/pkg/discovery/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 db924973b..616284188 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\"i\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(\t\022\024\n\014organization\030\004 \001(\tB\224\001\n,org.w" + + "ef\030\003 \001(\t\022\024\n\014organization\030\004 \001(\tB\233\001\n,org.w" + "so2.apk.enforcer.discovery.subscriptionB" + - "\027ApplicationMappingProtoP\001ZIgithub.com/w" + - "so2/apk/adapter/pkg/discovery/api/wso2/d" + - "iscovery/subscriptionb\006proto3" + "\027ApplicationMappingProtoP\001ZPgithub.com/w" + + "so2/apk/common-go-libs/pkg/discovery/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/ApplicationProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationProto.java index 49d0be32a..bfcf136f5 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 @@ -40,10 +40,11 @@ public static void registerAllExtensions( "\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" + "(\t:\0028\001B\224\001\n,org.wso2.apk.enforcer.discove" + + "ry.subscriptionB\020ApplicationProtoP\001ZPgit" + + "hub.com/wso2/apk/common-go-libs/pkg/disc" + + "overy/api/wso2/discovery/subscriptionb\006p" + + "roto3" }; 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/EventProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EventProto.java index 7c794cb2e..ddf36b01e 100644 --- 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 @@ -43,11 +43,11 @@ public static void registerAllExtensions( "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" + + "bscription.SubscriptionB\216\001\n,org.wso2.apk" + ".enforcer.discovery.subscriptionB\nEventP" + - "rotoP\001ZIgithub.com/wso2/apk/adapter/pkg/" + - "discovery/api/wso2/discovery/subscriptio" + - "nb\006proto3" + "rotoP\001ZPgithub.com/wso2/apk/common-go-li" + + "bs/pkg/discovery/api/wso2/discovery/subs" + + "criptionb\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/SubscriptionProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionProto.java index d8fe93be3..14e8baa70 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\216\001\n,org.wso2.ap" + + "e\030\001 \001(\t\022\017\n\007version\030\002 \001(\tB\225\001\n,org.wso2.ap" + "k.enforcer.discovery.subscriptionB\021Subsc" + - "riptionProtoP\001ZIgithub.com/wso2/apk/adap" + - "ter/pkg/discovery/api/wso2/discovery/sub" + - "scriptionb\006proto3" + "riptionProtoP\001ZPgithub.com/wso2/apk/comm" + + "on-go-libs/pkg/discovery/api/wso2/discov" + + "ery/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/util/GRPCUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java index 46bd86dbb..0395a9513 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 @@ -58,7 +58,6 @@ public static ManagedChannel createSecuredChannel(Logger logger, String host, in return NettyChannelBuilder.forAddress(host, port) .useTransportSecurity() .sslContext(sslContext) - .keepAliveTime(30, TimeUnit.SECONDS) .overrideAuthority(hostname) .build(); } diff --git a/protos/protogen.sh b/protos/protogen.sh new file mode 100755 index 000000000..2f3dcafd3 --- /dev/null +++ b/protos/protogen.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# -------------------------------------------------------------------- +# Copyright (c) 2022, WSO2 LLC. (http://wso2.com) 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. +# ----------------------------------------------------------------------- +set -e +PROTOC_VERSION=1.34_4 + +# get script location +cur_dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) +cd $cur_dir +rm -rf target +mkdir -p target/deps + +ADAPTER_GEN_DIR=$cur_dir/../common-controller/pkg/discovery/api/wso2/ +ENFORCER_GEN_DIR=$cur_dir/../gateway/enforcer/org.wso2.apk.enforcer/src/main/java/ +GREEN='\033[0;32m' +BOLD="\033[1m" +NC='\033[0m' # No Color + +# download dependency proto archives from github +echo "Downloading dependencies..." +wget https://github.com/cncf/udpa/archive/5459f2c994033b0afed7e4a70ac7e90c90c1ffee.tar.gz -nv -O target/deps/udpa.tar.gz +wget https://github.com/envoyproxy/data-plane-api//archive/d6828354ba6b4e67fd34ce41a14cbed9ad081b45.tar.gz -nv -O target/deps/envoy.tar.gz +wget https://github.com/envoyproxy/protoc-gen-validate/archive/refs/tags/v0.5.0.tar.gz -nv -O target/deps/validate.tar.gz +mkdir -p target/deps/udpa && tar -xf target/deps/udpa.tar.gz -C target/deps/udpa/ --strip-components 1 +mkdir -p target/deps/envoy && tar -xf target/deps/envoy.tar.gz -C target/deps/envoy/ --strip-components 1 +mkdir -p target/deps/validate && tar -xf target/deps/validate.tar.gz -C target/deps/validate/ --strip-components 1 + +printf "Preparing includes" +# create dependency proto include dir for protoc +mkdir -p target/include/ +cp -r target/deps/udpa/udpa target/include +cp -r target/deps/envoy/envoy target/include +cp -r target/deps/validate/validate target/include +printf " - ${GREEN}${BOLD}done${NC}\n" + +# generate code for java +printf "protoc java" +docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l java -i . -i target/include/ -o target/gen/java -d wso2/ +printf " - ${GREEN}${BOLD}done${NC}\n" + +# generate code for go grpc messages +# for golang build we have to generate code for each proto dir separately. +printf "protoc go messages" +docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go --go-source-relative -i . -i target/include/ -o target/gen/go -d wso2/discovery/subscription/ +printf " - ${GREEN}${BOLD}done${NC}\n" + +# map of proto imports for which we need to update the genrated import path +# ex: when the go code containing an import to `envoy/service/discovery/v3/discovery.proto`, +# we need the generated go code's import to be `github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3` +# not just `envoy/service/discovery/v3` +import_map=Menvoy/service/discovery/v3/discovery.proto=github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3 + +# generate code for go grpc services +docker run -v `pwd`:/defs namely/protoc-all:$PROTOC_VERSION -l go -i . -i target/include/ -o target/gen/go --go-package-map $import_map --go-source-relative -d wso2/discovery/service/apkmgt +printf "protoc go services - ${GREEN}${BOLD}done${NC}\n" + +rm -rf $ADAPTER_GEN_DIR +cp -r target/gen/go/* $ADAPTER_GEN_DIR +# Java generated implementations are not required for apkmgt related protobufs +rm -rf target/gen/java/org/wso2/choreo/connect/discovery/apkmgt +rm -rf target/gen/java/org/wso2/choreo/connect/discovery/service/apkmgt +rm -rf $ENFORCER_GEN_DIR/org/wso2/choreo/connect/discovery +cp -r target/gen/java/* $ENFORCER_GEN_DIR +rm -rf target + +# remove all the containers created +docker rm -f $(docker ps -a -q -f "ancestor=namely/protoc-all:$PROTOC_VERSION") + +printf "${GREEN}${BOLD}BUILD SUCCESS${NC}\n" diff --git a/protos/wso2/discovery/service/apkmgt/eventds.proto b/protos/wso2/discovery/service/apkmgt/eventds.proto new file mode 100644 index 000000000..7b03312ca --- /dev/null +++ b/protos/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/common-go-libs/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/protos/wso2/discovery/subscription/application.proto b/protos/wso2/discovery/subscription/application.proto new file mode 100644 index 000000000..b4ff4a75e --- /dev/null +++ b/protos/wso2/discovery/subscription/application.proto @@ -0,0 +1,35 @@ +/* + * 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; + +option go_package = "github.com/wso2/apk/common-go-libs/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; + +// [#protodoc-title: Application] + +// Application data model +message Application { + string uuid = 1; + string name = 2; + string owner = 3; + string organization = 4; + map attributes = 5; +} diff --git a/protos/wso2/discovery/subscription/application_key_mapping.proto b/protos/wso2/discovery/subscription/application_key_mapping.proto new file mode 100644 index 000000000..005dadae6 --- /dev/null +++ b/protos/wso2/discovery/subscription/application_key_mapping.proto @@ -0,0 +1,37 @@ +/* + * 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; + +option go_package = "github.com/wso2/apk/common-go-libs/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; + +// [#protodoc-title: ApplicationKeyMapping] + +// ApplicationKeyMapping data model +message ApplicationKeyMapping { + string applicationUUID = 1; + string securityScheme = 2; + string applicationIdentifier = 3; + string keyType = 4; + string envID = 5; + int64 timestamp = 6; + string organization = 7; +} diff --git a/protos/wso2/discovery/subscription/applicationmapping.proto b/protos/wso2/discovery/subscription/applicationmapping.proto new file mode 100644 index 000000000..ccd7376f6 --- /dev/null +++ b/protos/wso2/discovery/subscription/applicationmapping.proto @@ -0,0 +1,34 @@ +/* + * 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; + +option go_package = "github.com/wso2/apk/common-go-libs/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; + +// [#protodoc-title: ApplicationMapping] + +// ApplicationMapping data model +message ApplicationMapping { + string uuid = 1; + string applicationRef = 2; + string subscriptionRef = 3; + string organization = 4; +} diff --git a/protos/wso2/discovery/subscription/event.proto b/protos/wso2/discovery/subscription/event.proto new file mode 100644 index 000000000..ef3c4628b --- /dev/null +++ b/protos/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/common-go-libs/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/protos/wso2/discovery/subscription/subscription.proto b/protos/wso2/discovery/subscription/subscription.proto new file mode 100644 index 000000000..77c3a2481 --- /dev/null +++ b/protos/wso2/discovery/subscription/subscription.proto @@ -0,0 +1,39 @@ +/* + * 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; + +option go_package = "github.com/wso2/apk/common-go-libs/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; + +// [#protodoc-title: Subscription] + +// Subscription data model +message Subscription { + string subStatus = 1; + string uuid = 2; + string organization = 3; + SubscribedAPI subscribedApi = 4; +} + +message SubscribedAPI { + string name = 1; + string version = 2; +}