From db2b6a9c5026a815e3899725dedb45579dc364db Mon Sep 17 00:00:00 2001 From: Ashera Silva Date: Tue, 10 Oct 2023 15:40:26 +0530 Subject: [PATCH] Remove Admin rest api from enforcer --- .../discovery/config/enforcer/config.proto | 18 +- .../config/enforcer/rest_server.proto | 17 - adapter/config/default_config.go | 3 - adapter/internal/discovery/xds/marshaller.go | 5 - .../discovery/config/enforcer/config.pb.go | 191 +++---- .../config/enforcer/rest_server.pb.go | 156 ------ .../enforcer/admin/AdminServerHandler.java | 162 ------ .../admin/AdminServerInitializer.java | 52 -- .../wso2/apk/enforcer/admin/AdminUtils.java | 138 ----- .../admin/handlers/APIRequestHandler.java | 151 ------ .../handlers/ApplicationRequestHandler.java | 85 --- .../admin/handlers/RequestHandler.java | 34 -- .../handlers/RevokedTokensRequestHandler.java | 79 --- .../handlers/SubscriptionRequestHandler.java | 61 --- .../apk/enforcer/config/ConfigHolder.java | 11 - .../apk/enforcer/config/EnforcerConfig.java | 10 - .../config/dto/AdminRestServerDto.java | 33 -- .../discovery/config/enforcer/Config.java | 434 +++++---------- .../config/enforcer/ConfigOrBuilder.java | 61 +-- .../config/enforcer/ConfigProto.java | 61 +-- .../discovery/config/enforcer/RestServer.java | 508 ------------------ .../config/enforcer/RestServerOrBuilder.java | 19 - .../config/enforcer/RestServerProto.java | 52 -- .../wso2/apk/enforcer/server/RestServer.java | 20 +- 24 files changed, 268 insertions(+), 2093 deletions(-) delete mode 100644 adapter/api/proto/wso2/discovery/config/enforcer/rest_server.proto delete mode 100644 adapter/pkg/discovery/api/wso2/discovery/config/enforcer/rest_server.pb.go delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminServerHandler.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminServerInitializer.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminUtils.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/APIRequestHandler.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/ApplicationRequestHandler.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/RequestHandler.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/RevokedTokensRequestHandler.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/SubscriptionRequestHandler.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AdminRestServerDto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServer.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServerOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServerProto.java diff --git a/adapter/api/proto/wso2/discovery/config/enforcer/config.proto b/adapter/api/proto/wso2/discovery/config/enforcer/config.proto index 015d9f04b..265fe1f89 100644 --- a/adapter/api/proto/wso2/discovery/config/enforcer/config.proto +++ b/adapter/api/proto/wso2/discovery/config/enforcer/config.proto @@ -9,7 +9,6 @@ import "wso2/discovery/config/enforcer/cache.proto"; import "wso2/discovery/config/enforcer/analytics.proto"; import "wso2/discovery/config/enforcer/security.proto"; import "wso2/discovery/config/enforcer/management.proto"; -import "wso2/discovery/config/enforcer/rest_server.proto"; import "wso2/discovery/config/enforcer/filter.proto"; import "wso2/discovery/config/enforcer/tracing.proto"; import "wso2/discovery/config/enforcer/metrics.proto"; @@ -34,20 +33,17 @@ message Config { JWTGenerator jwtGenerator = 5; - Cache cache = 7; + Cache cache = 6; + Analytics analytics = 7; - Analytics analytics = 8; + Management management = 8; - Management management = 9; + Tracing tracing = 9; - RestServer restServer = 10; + Metrics metrics = 10; - Tracing tracing = 11; + repeated Filter filters = 11; - Metrics metrics = 12; - - repeated Filter filters = 13; - - Soap soap = 14; + Soap soap = 12; } diff --git a/adapter/api/proto/wso2/discovery/config/enforcer/rest_server.proto b/adapter/api/proto/wso2/discovery/config/enforcer/rest_server.proto deleted file mode 100644 index 1f3dd7e03..000000000 --- a/adapter/api/proto/wso2/discovery/config/enforcer/rest_server.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package wso2.discovery.config.enforcer; - -option go_package = "github.com/envoyproxy/go-control-plane/wso2/discovery/config/enforcer;enforcer"; -option java_package = "org.wso2.apk.enforcer.discovery.config.enforcer"; -option java_outer_classname = "RestServerProto"; -option java_multiple_files = true; - -// [#protodoc-title: SSL] - -// Model for enable/ disable enforcer admin rest api -message RestServer { - // Enable outbound auth header - bool enable = 1; - -} diff --git a/adapter/config/default_config.go b/adapter/config/default_config.go index fb8cba0cc..a99115552 100644 --- a/adapter/config/default_config.go +++ b/adapter/config/default_config.go @@ -145,9 +145,6 @@ var defaultConfig = &Config{ Username: "admin", Password: "admin", }, - RestServer: restServer{ - Enabled: true, - }, Security: security{ APIkey: apiKey{ Enabled: true, diff --git a/adapter/internal/discovery/xds/marshaller.go b/adapter/internal/discovery/xds/marshaller.go index d1cf5ea30..c8b7e5237 100644 --- a/adapter/internal/discovery/xds/marshaller.go +++ b/adapter/internal/discovery/xds/marshaller.go @@ -127,10 +127,6 @@ func MarshalConfig(config *config.Config) *enforcer.Config { Password: config.Enforcer.Management.Password, } - restServer := &enforcer.RestServer{ - Enable: config.Enforcer.RestServer.Enabled, - } - soap := &enforcer.Soap{ SoapErrorInXMLEnabled: config.Adapter.SoapErrorInXMLEnabled, } @@ -174,7 +170,6 @@ func MarshalConfig(config *config.Config) *enforcer.Config { Metrics: metrics, Analytics: analytics, Management: management, - RestServer: restServer, Filters: filters, Soap: soap, } diff --git a/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/config.pb.go b/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/config.pb.go index 1c770b9e4..1d313dcdb 100644 --- a/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/config.pb.go +++ b/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/config.pb.go @@ -31,14 +31,13 @@ type Config struct { Truststore *CertStore `protobuf:"bytes,3,opt,name=truststore,proto3" json:"truststore,omitempty"` AuthService *Service `protobuf:"bytes,4,opt,name=authService,proto3" json:"authService,omitempty"` JwtGenerator *JWTGenerator `protobuf:"bytes,5,opt,name=jwtGenerator,proto3" json:"jwtGenerator,omitempty"` - Cache *Cache `protobuf:"bytes,7,opt,name=cache,proto3" json:"cache,omitempty"` - Analytics *Analytics `protobuf:"bytes,8,opt,name=analytics,proto3" json:"analytics,omitempty"` - Management *Management `protobuf:"bytes,9,opt,name=management,proto3" json:"management,omitempty"` - RestServer *RestServer `protobuf:"bytes,10,opt,name=restServer,proto3" json:"restServer,omitempty"` - Tracing *Tracing `protobuf:"bytes,11,opt,name=tracing,proto3" json:"tracing,omitempty"` - Metrics *Metrics `protobuf:"bytes,12,opt,name=metrics,proto3" json:"metrics,omitempty"` - Filters []*Filter `protobuf:"bytes,13,rep,name=filters,proto3" json:"filters,omitempty"` - Soap *Soap `protobuf:"bytes,14,opt,name=soap,proto3" json:"soap,omitempty"` + Cache *Cache `protobuf:"bytes,6,opt,name=cache,proto3" json:"cache,omitempty"` + Analytics *Analytics `protobuf:"bytes,7,opt,name=analytics,proto3" json:"analytics,omitempty"` + Management *Management `protobuf:"bytes,8,opt,name=management,proto3" json:"management,omitempty"` + Tracing *Tracing `protobuf:"bytes,9,opt,name=tracing,proto3" json:"tracing,omitempty"` + Metrics *Metrics `protobuf:"bytes,10,opt,name=metrics,proto3" json:"metrics,omitempty"` + Filters []*Filter `protobuf:"bytes,11,rep,name=filters,proto3" json:"filters,omitempty"` + Soap *Soap `protobuf:"bytes,12,opt,name=soap,proto3" json:"soap,omitempty"` } func (x *Config) Reset() { @@ -129,13 +128,6 @@ func (x *Config) GetManagement() *Management { return nil } -func (x *Config) GetRestServer() *RestServer { - if x != nil { - return x.RestServer - } - return nil -} - func (x *Config) GetTracing() *Tracing { if x != nil { return x.Tracing @@ -192,89 +184,81 @@ var file_wso2_discovery_config_enforcer_config_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, - 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, - 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x66, - 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, + 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x66, 0x6f, 0x72, - 0x63, 0x65, 0x72, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x29, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x63, 0x65, 0x72, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x2c, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, - 0x72, 0x2f, 0x73, 0x6f, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x07, 0x0a, - 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x73, 0x6f, 0x32, - 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x45, 0x0a, - 0x08, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, - 0x2e, 0x43, 0x65, 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x74, 0x72, 0x75, 0x73, 0x74, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0x52, 0x0a, 0x74, 0x72, 0x75, 0x73, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, - 0x49, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, - 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0b, 0x61, - 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x0c, 0x6a, 0x77, - 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, - 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, - 0x72, 0x2e, 0x4a, 0x57, 0x54, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0c, - 0x6a, 0x77, 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x05, - 0x63, 0x61, 0x63, 0x68, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x73, - 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x43, 0x61, 0x63, - 0x68, 0x65, 0x52, 0x05, 0x63, 0x61, 0x63, 0x68, 0x65, 0x12, 0x47, 0x0a, 0x09, 0x61, 0x6e, 0x61, - 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, - 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x41, 0x6e, - 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x09, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, - 0x63, 0x73, 0x12, 0x4a, 0x0a, 0x0a, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, + 0x72, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x29, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2f, + 0x73, 0x6f, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd1, 0x06, 0x0a, 0x06, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x45, 0x0a, 0x08, 0x6b, + 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x43, + 0x65, 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x74, 0x72, 0x75, 0x73, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, - 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x0a, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4a, - 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x0a, 0x74, 0x72, 0x75, 0x73, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x49, 0x0a, + 0x0b, 0x61, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, - 0x63, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x0a, - 0x72, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x07, 0x74, 0x72, - 0x61, 0x63, 0x69, 0x6e, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x73, - 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x54, 0x72, 0x61, - 0x63, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x12, 0x41, 0x0a, - 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x63, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0b, 0x61, 0x75, 0x74, + 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x0c, 0x6a, 0x77, 0x74, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, - 0x12, 0x40, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, - 0x65, 0x72, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x73, 0x6f, 0x61, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x4a, 0x57, 0x54, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0c, 0x6a, 0x77, + 0x74, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x05, 0x63, 0x61, + 0x63, 0x68, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x73, 0x6f, 0x32, + 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, + 0x52, 0x05, 0x63, 0x61, 0x63, 0x68, 0x65, 0x12, 0x47, 0x0a, 0x09, 0x61, 0x6e, 0x61, 0x6c, 0x79, + 0x74, 0x69, 0x63, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x73, 0x6f, + 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x61, 0x6c, + 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x09, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, + 0x12, 0x4a, 0x0a, 0x0a, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, + 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x0a, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x07, + 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x2e, 0x54, + 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x12, + 0x41, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, - 0x72, 0x2e, 0x53, 0x6f, 0x61, 0x70, 0x52, 0x04, 0x73, 0x6f, 0x61, 0x70, 0x42, 0x90, 0x01, 0x0a, - 0x2f, 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, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, - 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, - 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x3b, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x12, 0x40, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0b, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, + 0x72, 0x63, 0x65, 0x72, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x73, 0x6f, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x61, 0x70, 0x52, 0x04, 0x73, 0x6f, 0x61, 0x70, 0x42, 0x90, + 0x01, 0x0a, 0x2f, 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, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, + 0x65, 0x72, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, + 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x3b, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -299,11 +283,10 @@ var file_wso2_discovery_config_enforcer_config_proto_goTypes = []interface{}{ (*Cache)(nil), // 5: wso2.discovery.config.enforcer.Cache (*Analytics)(nil), // 6: wso2.discovery.config.enforcer.Analytics (*Management)(nil), // 7: wso2.discovery.config.enforcer.Management - (*RestServer)(nil), // 8: wso2.discovery.config.enforcer.RestServer - (*Tracing)(nil), // 9: wso2.discovery.config.enforcer.Tracing - (*Metrics)(nil), // 10: wso2.discovery.config.enforcer.Metrics - (*Filter)(nil), // 11: wso2.discovery.config.enforcer.Filter - (*Soap)(nil), // 12: wso2.discovery.config.enforcer.Soap + (*Tracing)(nil), // 8: wso2.discovery.config.enforcer.Tracing + (*Metrics)(nil), // 9: wso2.discovery.config.enforcer.Metrics + (*Filter)(nil), // 10: wso2.discovery.config.enforcer.Filter + (*Soap)(nil), // 11: wso2.discovery.config.enforcer.Soap } var file_wso2_discovery_config_enforcer_config_proto_depIdxs = []int32{ 1, // 0: wso2.discovery.config.enforcer.Config.security:type_name -> wso2.discovery.config.enforcer.Security @@ -314,16 +297,15 @@ var file_wso2_discovery_config_enforcer_config_proto_depIdxs = []int32{ 5, // 5: wso2.discovery.config.enforcer.Config.cache:type_name -> wso2.discovery.config.enforcer.Cache 6, // 6: wso2.discovery.config.enforcer.Config.analytics:type_name -> wso2.discovery.config.enforcer.Analytics 7, // 7: wso2.discovery.config.enforcer.Config.management:type_name -> wso2.discovery.config.enforcer.Management - 8, // 8: wso2.discovery.config.enforcer.Config.restServer:type_name -> wso2.discovery.config.enforcer.RestServer - 9, // 9: wso2.discovery.config.enforcer.Config.tracing:type_name -> wso2.discovery.config.enforcer.Tracing - 10, // 10: wso2.discovery.config.enforcer.Config.metrics:type_name -> wso2.discovery.config.enforcer.Metrics - 11, // 11: wso2.discovery.config.enforcer.Config.filters:type_name -> wso2.discovery.config.enforcer.Filter - 12, // 12: wso2.discovery.config.enforcer.Config.soap:type_name -> wso2.discovery.config.enforcer.Soap - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 8, // 8: wso2.discovery.config.enforcer.Config.tracing:type_name -> wso2.discovery.config.enforcer.Tracing + 9, // 9: wso2.discovery.config.enforcer.Config.metrics:type_name -> wso2.discovery.config.enforcer.Metrics + 10, // 10: wso2.discovery.config.enforcer.Config.filters:type_name -> wso2.discovery.config.enforcer.Filter + 11, // 11: wso2.discovery.config.enforcer.Config.soap:type_name -> wso2.discovery.config.enforcer.Soap + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_wso2_discovery_config_enforcer_config_proto_init() } @@ -338,7 +320,6 @@ func file_wso2_discovery_config_enforcer_config_proto_init() { file_wso2_discovery_config_enforcer_analytics_proto_init() file_wso2_discovery_config_enforcer_security_proto_init() file_wso2_discovery_config_enforcer_management_proto_init() - file_wso2_discovery_config_enforcer_rest_server_proto_init() file_wso2_discovery_config_enforcer_filter_proto_init() file_wso2_discovery_config_enforcer_tracing_proto_init() file_wso2_discovery_config_enforcer_metrics_proto_init() diff --git a/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/rest_server.pb.go b/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/rest_server.pb.go deleted file mode 100644 index f0fc4e596..000000000 --- a/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/rest_server.pb.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 -// source: wso2/discovery/config/enforcer/rest_server.proto - -package enforcer - -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) -) - -// Model for enable/ disable enforcer admin rest api -type RestServer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Enable outbound auth header - Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` -} - -func (x *RestServer) Reset() { - *x = RestServer{} - if protoimpl.UnsafeEnabled { - mi := &file_wso2_discovery_config_enforcer_rest_server_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RestServer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestServer) ProtoMessage() {} - -func (x *RestServer) ProtoReflect() protoreflect.Message { - mi := &file_wso2_discovery_config_enforcer_rest_server_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 RestServer.ProtoReflect.Descriptor instead. -func (*RestServer) Descriptor() ([]byte, []int) { - return file_wso2_discovery_config_enforcer_rest_server_proto_rawDescGZIP(), []int{0} -} - -func (x *RestServer) GetEnable() bool { - if x != nil { - return x.Enable - } - return false -} - -var File_wso2_discovery_config_enforcer_rest_server_proto protoreflect.FileDescriptor - -var file_wso2_discovery_config_enforcer_rest_server_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, - 0x2f, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x1e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, - 0x65, 0x72, 0x22, 0x24, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x94, 0x01, 0x0a, 0x2f, 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, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x42, 0x0f, 0x52, 0x65, - 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, - 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, - 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x3b, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_wso2_discovery_config_enforcer_rest_server_proto_rawDescOnce sync.Once - file_wso2_discovery_config_enforcer_rest_server_proto_rawDescData = file_wso2_discovery_config_enforcer_rest_server_proto_rawDesc -) - -func file_wso2_discovery_config_enforcer_rest_server_proto_rawDescGZIP() []byte { - file_wso2_discovery_config_enforcer_rest_server_proto_rawDescOnce.Do(func() { - file_wso2_discovery_config_enforcer_rest_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_wso2_discovery_config_enforcer_rest_server_proto_rawDescData) - }) - return file_wso2_discovery_config_enforcer_rest_server_proto_rawDescData -} - -var file_wso2_discovery_config_enforcer_rest_server_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_wso2_discovery_config_enforcer_rest_server_proto_goTypes = []interface{}{ - (*RestServer)(nil), // 0: wso2.discovery.config.enforcer.RestServer -} -var file_wso2_discovery_config_enforcer_rest_server_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_config_enforcer_rest_server_proto_init() } -func file_wso2_discovery_config_enforcer_rest_server_proto_init() { - if File_wso2_discovery_config_enforcer_rest_server_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_wso2_discovery_config_enforcer_rest_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RestServer); 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_config_enforcer_rest_server_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_wso2_discovery_config_enforcer_rest_server_proto_goTypes, - DependencyIndexes: file_wso2_discovery_config_enforcer_rest_server_proto_depIdxs, - MessageInfos: file_wso2_discovery_config_enforcer_rest_server_proto_msgTypes, - }.Build() - File_wso2_discovery_config_enforcer_rest_server_proto = out.File - file_wso2_discovery_config_enforcer_rest_server_proto_rawDesc = nil - file_wso2_discovery_config_enforcer_rest_server_proto_goTypes = nil - file_wso2_discovery_config_enforcer_rest_server_proto_depIdxs = nil -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminServerHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminServerHandler.java deleted file mode 100644 index d13c6c65e..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminServerHandler.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.admin; - -import io.grpc.netty.shaded.io.netty.buffer.Unpooled; -import io.grpc.netty.shaded.io.netty.channel.ChannelHandlerContext; -import io.grpc.netty.shaded.io.netty.channel.ChannelInboundHandlerAdapter; -import io.grpc.netty.shaded.io.netty.handler.codec.http.DefaultFullHttpResponse; -import io.grpc.netty.shaded.io.netty.handler.codec.http.FullHttpRequest; -import io.grpc.netty.shaded.io.netty.handler.codec.http.FullHttpResponse; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpMethod; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpVersion; -import io.grpc.netty.shaded.io.netty.util.CharsetUtil; -import org.apache.http.protocol.HTTP; -import org.wso2.apk.enforcer.admin.handlers.APIRequestHandler; -import org.wso2.apk.enforcer.admin.handlers.ApplicationRequestHandler; -import org.wso2.apk.enforcer.admin.handlers.RequestHandler; -import org.wso2.apk.enforcer.admin.handlers.RevokedTokensRequestHandler; -import org.wso2.apk.enforcer.admin.handlers.SubscriptionRequestHandler; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.config.dto.ManagementCredentialsDto; -import org.wso2.apk.enforcer.constants.AdminConstants; -import org.wso2.apk.enforcer.constants.HttpConstants; -import org.wso2.apk.enforcer.models.ResponsePayload; - -import java.util.Base64; - -import static org.wso2.apk.enforcer.security.jwt.validator.JWTConstants.AUTHORIZATION; -/** - * Netty handler implementation for admin server. - */ -public class AdminServerHandler extends ChannelInboundHandlerAdapter { - - @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { - - FullHttpRequest request; - ResponsePayload responsePayload; - boolean isAuthorized = false; - - if (msg instanceof FullHttpRequest) { - request = (FullHttpRequest) msg; - } else { - // return error response; - String error = AdminConstants.ErrorMessages.INTERNAL_SERVER_ERROR; - responsePayload = new ResponsePayload(); - responsePayload.setError(true); - responsePayload.setStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR); - responsePayload.setContent(error); - buildAndSendResponse(ctx, responsePayload); - return; - } - String authHeader = request.headers().get(AUTHORIZATION); - - // Validate from new config - if (authHeader == null) { - String error = AdminConstants.ErrorMessages.NO_AUTH_HEADER_ERROR; - responsePayload = AdminUtils.buildResponsePayload(error, HttpResponseStatus.UNAUTHORIZED, true); - buildAndSendResponse(ctx, responsePayload); - return; - } else if (authHeader.toLowerCase().startsWith(HttpConstants.BASIC_LOWER)) { - try { - // Authorization: Basic base64credentials - String base64Credentials = authHeader.substring(HttpConstants.BASIC_LOWER.length()).trim(); - byte[] credDecoded = Base64.getDecoder().decode(base64Credentials); - String credentials = new String(credDecoded, CharsetUtil.UTF_8); - // credentials = username:password - final String[] values = credentials.split(":", 2); - - ManagementCredentialsDto managementCredentials = ConfigHolder.getInstance().getConfig() - .getManagement(); - isAuthorized = values[0].equals(managementCredentials.getUserName()) - && values[1].equals(new String(managementCredentials.getPassword())); - } catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) { - String error = AdminConstants.ErrorMessages.INTERNAL_SERVER_ERROR; - responsePayload = AdminUtils.buildResponsePayload(error, HttpResponseStatus.UNAUTHORIZED, true); - buildAndSendResponse(ctx, responsePayload); - return; - } - } - - if (!isAuthorized) { - String error = AdminConstants.ErrorMessages.UNAUTHORIZED_ERROR; - responsePayload = AdminUtils.buildResponsePayload(error, HttpResponseStatus.UNAUTHORIZED, true); - buildAndSendResponse(ctx, responsePayload); - return; - } - - if (HttpMethod.GET != request.method()) { - // return error - String error = AdminConstants.ErrorMessages.METHOD_NOT_IMPLEMENTED; - responsePayload = AdminUtils.buildResponsePayload(error, HttpResponseStatus.NOT_IMPLEMENTED, true); - } else { - // Check request uri and invoke correct handler - String[] uriSections = request.uri().split("\\?"); - String[] params = null; - String baseURI = uriSections[0]; - if (uriSections.length > 1) { - params = uriSections[1].split("&"); - } - RequestHandler requestHandler; - - switch (baseURI) { - case AdminConstants.AdminResources.API_INFO: - requestHandler = new APIRequestHandler(); - responsePayload = requestHandler.handleRequest(params, AdminConstants.API_INFO_TYPE); - break; - case AdminConstants.AdminResources.APIS: - requestHandler = new APIRequestHandler(); - responsePayload = requestHandler.handleRequest(params, AdminConstants.API_TYPE); - break; - case AdminConstants.AdminResources.APPLICATIONS: - requestHandler = new ApplicationRequestHandler(); - responsePayload = requestHandler.handleRequest(params, AdminConstants.APPLICATION_TYPE); - break; - case AdminConstants.AdminResources.SUBSCRIPTIONS: - requestHandler = new SubscriptionRequestHandler(); - responsePayload = requestHandler.handleRequest(params, AdminConstants.SUBSCRIPTION_TYPE); - break; - case AdminConstants.AdminResources.REVOKED_TOKENS: - requestHandler = new RevokedTokensRequestHandler(); - responsePayload = requestHandler.handleRequest(params, AdminConstants.REVOKED_TOKEN_TYPE); - break; - default: - String error = AdminConstants.ErrorMessages.RESOURCE_NOT_FOUND_ERROR; - responsePayload = AdminUtils.buildResponsePayload(error, HttpResponseStatus.NOT_FOUND, true); - break; - } - } - buildAndSendResponse(ctx, responsePayload); - } - - @Override - public void channelReadComplete(ChannelHandlerContext ctx) { - ctx.flush(); - } - - private void buildAndSendResponse(ChannelHandlerContext ctx, ResponsePayload response) { - FullHttpResponse httpResponse = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, - response.getStatus(), - Unpooled.copiedBuffer(response.getContent(), CharsetUtil.UTF_8)); - httpResponse.headers().set(HTTP.CONTENT_TYPE, HttpConstants.APPLICATION_JSON); - httpResponse.headers().set(HTTP.CONTENT_LEN, httpResponse.content().readableBytes()); - ctx.writeAndFlush(httpResponse); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminServerInitializer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminServerInitializer.java deleted file mode 100644 index 80826c574..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminServerInitializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.admin; - -import io.grpc.netty.shaded.io.netty.channel.ChannelInitializer; -import io.grpc.netty.shaded.io.netty.channel.ChannelPipeline; -import io.grpc.netty.shaded.io.netty.channel.socket.SocketChannel; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpObjectAggregator; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpRequestEncoder; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpServerCodec; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpServerExpectContinueHandler; -import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; - -/** - * This is the http admin server initializer implementation. - */ -public class AdminServerInitializer extends ChannelInitializer { - private final SslContext sslCtx; - - public AdminServerInitializer(SslContext sslCtx) { - this.sslCtx = sslCtx; - } - - @Override - public void initChannel(SocketChannel ch) { - ChannelPipeline p = ch.pipeline(); - if (sslCtx != null) { - p.addLast(sslCtx.newHandler(ch.alloc())); - } - p.addLast(new HttpServerCodec()); - p.addLast(new HttpServerExpectContinueHandler()); - p.addLast(new HttpObjectAggregator(1048576)); - p.addLast(new HttpRequestEncoder()); - p.addLast(new AdminServerHandler()); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminUtils.java deleted file mode 100644 index 13854490e..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/AdminUtils.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.admin; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; -import org.wso2.apk.enforcer.models.API; -import org.wso2.apk.enforcer.models.APIInfo; -import org.wso2.apk.enforcer.models.Application; -import org.wso2.apk.enforcer.models.ApplicationInfo; -import org.wso2.apk.enforcer.models.ApplicationInfoList; -import org.wso2.apk.enforcer.models.ApplicationKeyMapping; -import org.wso2.apk.enforcer.models.ApplicationPolicy; -import org.wso2.apk.enforcer.models.ApplicationPolicyList; -import org.wso2.apk.enforcer.models.ResponsePayload; -import org.wso2.apk.enforcer.models.RevokedToken; -import org.wso2.apk.enforcer.models.RevokedTokenList; -import org.wso2.apk.enforcer.models.Subscription; -import org.wso2.apk.enforcer.models.SubscriptionInfo; -import org.wso2.apk.enforcer.models.SubscriptionList; -import org.wso2.apk.enforcer.models.SubscriptionPolicy; -import org.wso2.apk.enforcer.models.SubscriptionPolicyList; - -import java.util.List; - -/** - * Utility class for internal admin functions - */ -public class AdminUtils { - - public static APIInfo toAPIInfo(API api, List subscriptionInfoList) { - APIInfo apiInfo = new APIInfo(); - apiInfo.setSubscriptions(subscriptionInfoList); - apiInfo.setApiId(api.getApiId()); - apiInfo.setApiUUID(api.getApiUUID()); - apiInfo.setContext(api.getContext()); - apiInfo.setName(api.getApiName()); - apiInfo.setLcState(api.getLcState()); - apiInfo.setTier(api.getApiTier()); - apiInfo.setVersion(api.getApiVersion()); - apiInfo.setProvider(api.getApiProvider()); - return apiInfo; - } - - public static ApplicationInfo toApplicationInfo(Application application, - ApplicationKeyMapping applicationKeyMapping) { - ApplicationInfo applicationInfo = new ApplicationInfo(); - applicationInfo.setConsumerKey(applicationKeyMapping.getConsumerKey()); - applicationInfo.setUuid(application.getUUID()); - applicationInfo.setName(application.getName()); - applicationInfo.setPolicy(application.getPolicy()); - applicationInfo.setId(application.getId()); - applicationInfo.setSubId(application.getSubId()); - applicationInfo.setSubName(application.getSubName()); - applicationInfo.setTenantDomain(application.getTenantDomain()); - return applicationInfo; - } - - public static SubscriptionInfo toSubscriptionInfo(Subscription subscription, - ApplicationInfo applicationInfo) { - SubscriptionInfo subscriptionInfo = new SubscriptionInfo(); - subscriptionInfo.setApplicationInfo(applicationInfo); - subscriptionInfo.setApiUUID(subscription.getApiUUID()); - subscriptionInfo.setAppUUID(subscription.getAppUUID()); - subscriptionInfo.setPolicyId(subscription.getPolicyId()); - subscriptionInfo.setSubscriptionId(subscription.getSubscriptionId()); - subscriptionInfo.setSubscriptionState(subscription.getSubscriptionState()); - return subscriptionInfo; - } - - public static ApplicationInfoList toApplicationInfoList(List applications) { - ApplicationInfoList applicationInfoList = new ApplicationInfoList(); - applicationInfoList.setCount(applications.size()); - applicationInfoList.setList(applications); - return applicationInfoList; - } - - public static SubscriptionList toSubscriptionsList(List subscriptions) { - SubscriptionList subscriptionList = new SubscriptionList(); - subscriptionList.setCount(subscriptions.size()); - subscriptionList.setList(subscriptions); - return subscriptionList; - } - - public static ApplicationPolicyList toApplicationPolicyList(List applicationPolicies) { - ApplicationPolicyList applicationPolicyList = new ApplicationPolicyList(); - applicationPolicyList.setCount(applicationPolicies.size()); - applicationPolicyList.setList(applicationPolicies); - return applicationPolicyList; - } - - public static SubscriptionPolicyList toSubscriptionPolicyList(List subscriptionPolicies) { - SubscriptionPolicyList subscriptionPolicyList = new SubscriptionPolicyList(); - subscriptionPolicyList.setCount(subscriptionPolicies.size()); - subscriptionPolicyList.setList(subscriptionPolicies); - return subscriptionPolicyList; - } - - public static ResponsePayload buildResponsePayload(Object dataModel, HttpResponseStatus status, boolean isError) - throws JsonProcessingException { - - String jsonPayload; - ObjectMapper objectMapper = new ObjectMapper(); - if (!(dataModel instanceof String)) { - jsonPayload = objectMapper.writeValueAsString(dataModel); - } else { - jsonPayload = (String) dataModel; - } - ResponsePayload responsePayload = new ResponsePayload(); - responsePayload.setContent(jsonPayload); - responsePayload.setError(isError); - responsePayload.setStatus(status); - return responsePayload; - } - - public static RevokedTokenList toRevokedTokenList(List revokedTokens) { - RevokedTokenList revokedTokenList = new RevokedTokenList(); - revokedTokenList.setCount(revokedTokens.size()); - revokedTokenList.setTokens(revokedTokens); - return revokedTokenList; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/APIRequestHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/APIRequestHandler.java deleted file mode 100644 index 8224534a3..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/APIRequestHandler.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.admin.handlers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; -import org.wso2.apk.enforcer.admin.AdminUtils; -import org.wso2.apk.enforcer.constants.AdminConstants; -import org.wso2.apk.enforcer.models.API; -import org.wso2.apk.enforcer.models.APIInfo; -import org.wso2.apk.enforcer.models.APIList; -import org.wso2.apk.enforcer.models.Application; -import org.wso2.apk.enforcer.models.ApplicationInfo; -import org.wso2.apk.enforcer.models.ApplicationKeyMapping; -import org.wso2.apk.enforcer.models.ResponsePayload; -import org.wso2.apk.enforcer.models.Subscription; -import org.wso2.apk.enforcer.models.SubscriptionInfo; - -import java.util.ArrayList; -import java.util.List; - -/** - * Handler implementation for API requests. - */ -public class APIRequestHandler extends RequestHandler { - - @Override - public ResponsePayload handleRequest(String[] params, String requestType) throws Exception { - - if (AdminConstants.API_TYPE.equals(requestType)) { - return getAPIs(params); - } else { - return getAPIInfo(params); - } - } - - /** - * Method to get apis which match the given parameters - * - * @param params Array of parameters - * @return ResponsePayload with APIs as APIList object. - * */ - private ResponsePayload getAPIs(String[] params) throws JsonProcessingException { - List apis; - String name = null; - String version = null; - String context = null; - String uuid = null; - if (params != null) { - for (String param : params) { - String[] keyVal = param.split("="); - switch (keyVal[0]) { - case AdminConstants.Parameters.NAME: - name = keyVal[1]; - break; - case AdminConstants.Parameters.CONTEXT: - context = keyVal[1]; - break; - case AdminConstants.Parameters.VERSION: - version = keyVal[1]; - break; - case AdminConstants.Parameters.API_UUID: - uuid = keyVal[1]; - break; - default: - break; - } - } - } - apis = super.dataStore.getMatchingAPIs(name, context, version, uuid); - APIList apiList = new APIList(); - apiList.setCount(apis.size()); - apiList.setList(apis); - return AdminUtils.buildResponsePayload(apiList, HttpResponseStatus.OK, false); - - } - - /** - * Method to get the api information (along with subscription, - * application and key mapping) for a provided api context and version - * - * @param params API Context and API version - * @return APIInfo in as a ResponsePayload object. - * @throws JsonProcessingException - */ - private ResponsePayload getAPIInfo(String[] params) throws JsonProcessingException { - APIInfo apiInfo; - String context = null; - String version = null; - if (params == null || params.length < 2) { - // Bad request - String responseMessage = "{" + - "\"error\": true, " + - "\"message\": \"Query parameters context and version could not be empty\"}"; - return AdminUtils.buildResponsePayload(responseMessage, HttpResponseStatus.BAD_REQUEST, true); - } - for (String param : params) { - if (param.contains(AdminConstants.Parameters.CONTEXT)) { - context = param.split("=")[1]; - } - if (param.contains(AdminConstants.Parameters.VERSION)) { - version = param.split("=")[1]; - } - } - API matchingAPI = super.dataStore.getMatchingAPI(context, version); - if (matchingAPI != null) { - List matchingSubscriptions = dataStore. - getMatchingSubscriptions(null, matchingAPI.getApiUUID(), null); - List subscriptionInfoList = new ArrayList<>(); - // For each subscription, build the Subscription info with application and key mapping. - for (Subscription subscription : matchingSubscriptions) { - Application matchingApplication = dataStore.getApplicationById(subscription.getAppUUID()); - List applicationKeyMapping; - ApplicationInfo applicationInfo = null; - if (matchingApplication != null) { - applicationKeyMapping = dataStore.getMatchingKeyMapping(matchingApplication.getUUID(), null); - if (applicationKeyMapping.size() > 0) { - // should be only one entry - applicationInfo = AdminUtils.toApplicationInfo(matchingApplication, - applicationKeyMapping.get(0)); - } - } - SubscriptionInfo subscriptionInfo = AdminUtils.toSubscriptionInfo(subscription, applicationInfo); - subscriptionInfoList.add(subscriptionInfo); - } - apiInfo = AdminUtils.toAPIInfo(matchingAPI, subscriptionInfoList); - return AdminUtils.buildResponsePayload(apiInfo, HttpResponseStatus.OK, false); - } else { - // No api found for the provided search parameters... - // return empty response. - String message = "{\"error\": true,\"message\":\"No API information found for context " - + context + " and version " + version + "\"}"; - return AdminUtils.buildResponsePayload(message, HttpResponseStatus.NOT_FOUND, true); - } - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/ApplicationRequestHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/ApplicationRequestHandler.java deleted file mode 100644 index 1b41cedab..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/ApplicationRequestHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.admin.handlers; - -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; -import org.apache.commons.lang3.StringUtils; -import org.wso2.apk.enforcer.admin.AdminUtils; -import org.wso2.apk.enforcer.constants.AdminConstants; -import org.wso2.apk.enforcer.models.Application; -import org.wso2.apk.enforcer.models.ApplicationInfo; -import org.wso2.apk.enforcer.models.ApplicationInfoList; -import org.wso2.apk.enforcer.models.ApplicationKeyMapping; -import org.wso2.apk.enforcer.models.ResponsePayload; - -import java.util.ArrayList; -import java.util.List; - -/** - * Handler implementation for Application requests - */ -public class ApplicationRequestHandler extends RequestHandler { - - @Override - public ResponsePayload handleRequest(String[] params, String requestType) throws Exception { - - List applicationList; - String name = null; - String organizationID = null; - String uuid = null; - String consumerKey = null; - List applicationInfoList = new ArrayList<>(); - // If params is null, return all the applications - if (params != null) { - for (String param : params) { - String[] parameterParts = param.split("="); - switch (parameterParts[0]) { - case AdminConstants.Parameters.NAME: - name = parameterParts[1]; - break; - case AdminConstants.Parameters.APP_UUID: - uuid = parameterParts[1]; - break; - case AdminConstants.Parameters.ORGANIZATION_ID: - organizationID = parameterParts[1]; - break; - case AdminConstants.Parameters.CONSUMER_KEY: - consumerKey = parameterParts[1]; - break; - default: - break; - } - } - } - if (StringUtils.isEmpty(organizationID)) { - String error = "{\"error\": true, \"message\":\"Organization id should not be empty.\"}"; - return AdminUtils.buildResponsePayload(error, HttpResponseStatus.BAD_REQUEST, true); - } - applicationList = super.dataStore.getMatchingApplications(name, organizationID, uuid); - for (Application application : applicationList) { - List keyMappingList = dataStore.getMatchingKeyMapping(application.getUUID(), - consumerKey); - for (ApplicationKeyMapping applicationKeyMapping : keyMappingList) { - ApplicationInfo applicationInfo = AdminUtils.toApplicationInfo(application, applicationKeyMapping); - applicationInfoList.add(applicationInfo); - } - } - ApplicationInfoList applicationInfos = AdminUtils.toApplicationInfoList(applicationInfoList); - return AdminUtils.buildResponsePayload(applicationInfos, HttpResponseStatus.OK, false); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/RequestHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/RequestHandler.java deleted file mode 100644 index 2cf150888..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/RequestHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.admin.handlers; - -import org.wso2.apk.enforcer.models.ResponsePayload; -import org.wso2.apk.enforcer.subscription.SubscriptionDataHolder; -import org.wso2.apk.enforcer.subscription.SubscriptionDataStore; - - -/** - * The Request Handler interface - */ -public abstract class RequestHandler { - - final SubscriptionDataStore dataStore = SubscriptionDataHolder.getInstance().getTenantSubscriptionStore(); - - public abstract ResponsePayload handleRequest(String[] params, String requestType) throws Exception; - -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/RevokedTokensRequestHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/RevokedTokensRequestHandler.java deleted file mode 100644 index 8ecb37e58..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/RevokedTokensRequestHandler.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.admin.handlers; - -import com.nimbusds.jwt.SignedJWT; -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; -import org.wso2.apk.enforcer.admin.AdminUtils; -import org.wso2.apk.enforcer.constants.AdminConstants; -import org.wso2.apk.enforcer.models.ResponsePayload; -import org.wso2.apk.enforcer.models.RevokedToken; -import org.wso2.apk.enforcer.models.RevokedTokenList; -import org.wso2.apk.enforcer.security.jwt.validator.RevokedJWTDataHolder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Request handler implementation for revoked tokens - */ -public class RevokedTokensRequestHandler extends RequestHandler { - @Override - public ResponsePayload handleRequest(String[] params, String requestType) throws Exception { - - List revokedTokens = new ArrayList<>(); - RevokedJWTDataHolder revokedJWTDataHolder = RevokedJWTDataHolder.getInstance(); - Map revokedJWTMap = revokedJWTDataHolder.getRevokedJWTMap(); - String token; - - if (params != null) { - for (String param : params) { - String[] tokenParam = param.split("="); - if (AdminConstants.Parameters.TOKEN.equals(tokenParam[0])) { - token = tokenParam[1]; - String[] tokenParts = token.split("\\."); - if (tokenParts.length > 2) { - // this is a jwt token... Get the jti - SignedJWT signedJWT = SignedJWT.parse(token); - token = signedJWT.getJWTClaimsSet().getJWTID(); - - if (revokedJWTMap.containsKey(token)) { - RevokedToken revokedToken = new RevokedToken(); - revokedToken.setToken(token); - revokedToken.setExpiredTime(revokedJWTMap.get(token)); - revokedTokens.add(revokedToken); - } - } - } - } - - } else { - // Return all the tokens... - for (Map.Entry e : revokedJWTMap.entrySet()) { - RevokedToken revokedToken = new RevokedToken(); - revokedToken.setToken(e.getKey()); - revokedToken.setExpiredTime(e.getValue()); - revokedTokens.add(revokedToken); - } - } - - RevokedTokenList revokedTokenList = AdminUtils.toRevokedTokenList(revokedTokens); - return AdminUtils.buildResponsePayload(revokedTokenList, HttpResponseStatus.OK, false); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/SubscriptionRequestHandler.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/SubscriptionRequestHandler.java deleted file mode 100644 index e6a1e2a01..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/admin/handlers/SubscriptionRequestHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.admin.handlers; - -import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus; -import org.wso2.apk.enforcer.admin.AdminUtils; -import org.wso2.apk.enforcer.constants.AdminConstants; -import org.wso2.apk.enforcer.models.ResponsePayload; -import org.wso2.apk.enforcer.models.Subscription; -import org.wso2.apk.enforcer.models.SubscriptionList; - -import java.util.List; - -/** - * Request Handler implementation for Subscriptions - */ -public class SubscriptionRequestHandler extends RequestHandler { - @Override - public ResponsePayload handleRequest(String[] params, String requestType) throws Exception { - String apiUUID = null; - String appUUID = null; - String state = null; - - if (params != null) { - for (String param : params) { - String[] paramKeyVal = param.split("="); - switch (paramKeyVal[0]) { - case AdminConstants.Parameters.API_UUID: - apiUUID = paramKeyVal[1]; - break; - case AdminConstants.Parameters.APP_UUID: - appUUID = paramKeyVal[1]; - break; - case AdminConstants.Parameters.STATE: - state = paramKeyVal[1]; - break; - default: - break; - } - } - } - List subscriptions = super.dataStore.getMatchingSubscriptions(appUUID, apiUUID, state); - SubscriptionList subscriptionList = AdminUtils.toSubscriptionsList(subscriptions); - return AdminUtils.buildResponsePayload(subscriptionList, HttpResponseStatus.OK, false); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java index 722ba3096..3cca39d98 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java @@ -30,7 +30,6 @@ import org.wso2.apk.enforcer.commons.dto.JWTConfigurationDto; import org.wso2.apk.enforcer.commons.exception.EnforcerException; import org.wso2.apk.enforcer.config.dto.APIKeyIssuerDto; -import org.wso2.apk.enforcer.config.dto.AdminRestServerDto; import org.wso2.apk.enforcer.config.dto.AnalyticsDTO; import org.wso2.apk.enforcer.config.dto.AnalyticsReceiverConfigDTO; import org.wso2.apk.enforcer.config.dto.AuthServiceConfigurationDto; @@ -54,7 +53,6 @@ import org.wso2.apk.enforcer.discovery.config.enforcer.Management; import org.wso2.apk.enforcer.discovery.config.enforcer.Metrics; import org.wso2.apk.enforcer.discovery.config.enforcer.MutualSSL; -import org.wso2.apk.enforcer.discovery.config.enforcer.RestServer; import org.wso2.apk.enforcer.discovery.config.enforcer.Service; import org.wso2.apk.enforcer.discovery.config.enforcer.Soap; import org.wso2.apk.enforcer.discovery.config.enforcer.Tracing; @@ -153,8 +151,6 @@ private void parseConfigs(Config config) { populateManagementCredentials(config.getManagement()); - populateRestServer(config.getRestServer()); - // Populates the SOAP error response related configs (SoapErrorInXMLEnabled). populateSoapErrorResponseConfigs(config.getSoap()); @@ -197,13 +193,6 @@ private void populateSoapErrorResponseConfigs(Soap soap) { config.setSoapErrorResponseConfigDto(soapErrorResponseConfigDto); } - private void populateRestServer(RestServer restServer) { - - AdminRestServerDto adminRestServerDto = new AdminRestServerDto(); - adminRestServerDto.setEnable(restServer.getEnable()); - config.setRestServer(adminRestServerDto); - } - private void populateManagementCredentials(Management management) { ManagementCredentialsDto managementCredentialsDto = new ManagementCredentialsDto(); diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnforcerConfig.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnforcerConfig.java index fe17af4e3..c6c2851d8 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnforcerConfig.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/EnforcerConfig.java @@ -22,7 +22,6 @@ import org.wso2.apk.enforcer.commons.jwttransformer.DefaultJWTTransformer; import org.wso2.apk.enforcer.commons.jwttransformer.JWTTransformer; import org.wso2.apk.enforcer.config.dto.APIKeyIssuerDto; -import org.wso2.apk.enforcer.config.dto.AdminRestServerDto; import org.wso2.apk.enforcer.config.dto.AnalyticsDTO; import org.wso2.apk.enforcer.config.dto.AuthServiceConfigurationDto; import org.wso2.apk.enforcer.config.dto.CacheDto; @@ -57,7 +56,6 @@ public class EnforcerConfig { private final Map jwtTransformerMap = new HashMap<>(); private MutualSSLDto mtlsInfo; private ManagementCredentialsDto management; - private AdminRestServerDto restServer; private FilterDTO[] customFilters; private SoapErrorResponseConfigDto soapErrorResponseConfigDto; @@ -163,14 +161,6 @@ public void setManagement(ManagementCredentialsDto management) { this.management = management; } - public AdminRestServerDto getRestServer() { - return restServer; - } - - public void setRestServer(AdminRestServerDto restServer) { - this.restServer = restServer; - } - public SoapErrorResponseConfigDto getSoapErrorResponseConfigDto() { return soapErrorResponseConfigDto; } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AdminRestServerDto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AdminRestServerDto.java deleted file mode 100644 index 7aa4c7848..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/dto/AdminRestServerDto.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.apk.enforcer.config.dto; - -/** - * Configuration for enabling Admin Rest api - * */ -public class AdminRestServerDto { - private boolean enable; - - public boolean isEnable() { - return enable; - } - - public void setEnable(boolean enable) { - this.enable = enable; - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Config.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Config.java index e9e6d0986..fbf6dd728 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Config.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/Config.java @@ -119,7 +119,7 @@ private Config( break; } - case 58: { + case 50: { org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder subBuilder = null; if (cache_ != null) { subBuilder = cache_.toBuilder(); @@ -132,7 +132,7 @@ private Config( break; } - case 66: { + case 58: { org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder subBuilder = null; if (analytics_ != null) { subBuilder = analytics_.toBuilder(); @@ -145,7 +145,7 @@ private Config( break; } - case 74: { + case 66: { org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder subBuilder = null; if (management_ != null) { subBuilder = management_.toBuilder(); @@ -158,20 +158,7 @@ private Config( break; } - case 82: { - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.Builder subBuilder = null; - if (restServer_ != null) { - subBuilder = restServer_.toBuilder(); - } - restServer_ = input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(restServer_); - restServer_ = subBuilder.buildPartial(); - } - - break; - } - case 90: { + case 74: { org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder subBuilder = null; if (tracing_ != null) { subBuilder = tracing_.toBuilder(); @@ -184,7 +171,7 @@ private Config( break; } - case 98: { + case 82: { org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder subBuilder = null; if (metrics_ != null) { subBuilder = metrics_.toBuilder(); @@ -197,7 +184,7 @@ private Config( break; } - case 106: { + case 90: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { filters_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; @@ -206,7 +193,7 @@ private Config( input.readMessage(org.wso2.apk.enforcer.discovery.config.enforcer.Filter.parser(), extensionRegistry)); break; } - case 114: { + case 98: { org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder subBuilder = null; if (soap_ != null) { subBuilder = soap_.toBuilder(); @@ -384,10 +371,10 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder get return getJwtGenerator(); } - public static final int CACHE_FIELD_NUMBER = 7; + public static final int CACHE_FIELD_NUMBER = 6; private org.wso2.apk.enforcer.discovery.config.enforcer.Cache cache_; /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; * @return Whether the cache field is set. */ @java.lang.Override @@ -395,7 +382,7 @@ public boolean hasCache() { return cache_ != null; } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; * @return The cache. */ @java.lang.Override @@ -403,17 +390,17 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Cache getCache() { return cache_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Cache.getDefaultInstance() : cache_; } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ @java.lang.Override public org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder getCacheOrBuilder() { return getCache(); } - public static final int ANALYTICS_FIELD_NUMBER = 8; + public static final int ANALYTICS_FIELD_NUMBER = 7; private org.wso2.apk.enforcer.discovery.config.enforcer.Analytics analytics_; /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; * @return Whether the analytics field is set. */ @java.lang.Override @@ -421,7 +408,7 @@ public boolean hasAnalytics() { return analytics_ != null; } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; * @return The analytics. */ @java.lang.Override @@ -429,17 +416,17 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics getAnalytics() return analytics_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.getDefaultInstance() : analytics_; } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ @java.lang.Override public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder getAnalyticsOrBuilder() { return getAnalytics(); } - public static final int MANAGEMENT_FIELD_NUMBER = 9; + public static final int MANAGEMENT_FIELD_NUMBER = 8; private org.wso2.apk.enforcer.discovery.config.enforcer.Management management_; /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; * @return Whether the management field is set. */ @java.lang.Override @@ -447,7 +434,7 @@ public boolean hasManagement() { return management_ != null; } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; * @return The management. */ @java.lang.Override @@ -455,43 +442,17 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Management getManagement( return management_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Management.getDefaultInstance() : management_; } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ @java.lang.Override public org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder getManagementOrBuilder() { return getManagement(); } - public static final int RESTSERVER_FIELD_NUMBER = 10; - private org.wso2.apk.enforcer.discovery.config.enforcer.RestServer restServer_; - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - * @return Whether the restServer field is set. - */ - @java.lang.Override - public boolean hasRestServer() { - return restServer_ != null; - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - * @return The restServer. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServer getRestServer() { - return restServer_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.getDefaultInstance() : restServer_; - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServerOrBuilder getRestServerOrBuilder() { - return getRestServer(); - } - - public static final int TRACING_FIELD_NUMBER = 11; + public static final int TRACING_FIELD_NUMBER = 9; private org.wso2.apk.enforcer.discovery.config.enforcer.Tracing tracing_; /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; * @return Whether the tracing field is set. */ @java.lang.Override @@ -499,7 +460,7 @@ public boolean hasTracing() { return tracing_ != null; } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; * @return The tracing. */ @java.lang.Override @@ -507,17 +468,17 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing getTracing() { return tracing_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.getDefaultInstance() : tracing_; } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ @java.lang.Override public org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder getTracingOrBuilder() { return getTracing(); } - public static final int METRICS_FIELD_NUMBER = 12; + public static final int METRICS_FIELD_NUMBER = 10; private org.wso2.apk.enforcer.discovery.config.enforcer.Metrics metrics_; /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; * @return Whether the metrics field is set. */ @java.lang.Override @@ -525,7 +486,7 @@ public boolean hasMetrics() { return metrics_ != null; } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; * @return The metrics. */ @java.lang.Override @@ -533,24 +494,24 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics getMetrics() { return metrics_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.getDefaultInstance() : metrics_; } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ @java.lang.Override public org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder getMetricsOrBuilder() { return getMetrics(); } - public static final int FILTERS_FIELD_NUMBER = 13; + public static final int FILTERS_FIELD_NUMBER = 11; private java.util.List filters_; /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ @java.lang.Override public java.util.List getFiltersList() { return filters_; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ @java.lang.Override public java.util.List @@ -558,21 +519,21 @@ public java.util.List ge return filters_; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ @java.lang.Override public int getFiltersCount() { return filters_.size(); } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ @java.lang.Override public org.wso2.apk.enforcer.discovery.config.enforcer.Filter getFilters(int index) { return filters_.get(index); } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ @java.lang.Override public org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder getFiltersOrBuilder( @@ -580,10 +541,10 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder getFilter return filters_.get(index); } - public static final int SOAP_FIELD_NUMBER = 14; + public static final int SOAP_FIELD_NUMBER = 12; private org.wso2.apk.enforcer.discovery.config.enforcer.Soap soap_; /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; * @return Whether the soap field is set. */ @java.lang.Override @@ -591,7 +552,7 @@ public boolean hasSoap() { return soap_ != null; } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; * @return The soap. */ @java.lang.Override @@ -599,7 +560,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Soap getSoap() { return soap_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.Soap.getDefaultInstance() : soap_; } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ @java.lang.Override public org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder getSoapOrBuilder() { @@ -636,28 +597,25 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeMessage(5, getJwtGenerator()); } if (cache_ != null) { - output.writeMessage(7, getCache()); + output.writeMessage(6, getCache()); } if (analytics_ != null) { - output.writeMessage(8, getAnalytics()); + output.writeMessage(7, getAnalytics()); } if (management_ != null) { - output.writeMessage(9, getManagement()); - } - if (restServer_ != null) { - output.writeMessage(10, getRestServer()); + output.writeMessage(8, getManagement()); } if (tracing_ != null) { - output.writeMessage(11, getTracing()); + output.writeMessage(9, getTracing()); } if (metrics_ != null) { - output.writeMessage(12, getMetrics()); + output.writeMessage(10, getMetrics()); } for (int i = 0; i < filters_.size(); i++) { - output.writeMessage(13, filters_.get(i)); + output.writeMessage(11, filters_.get(i)); } if (soap_ != null) { - output.writeMessage(14, getSoap()); + output.writeMessage(12, getSoap()); } unknownFields.writeTo(output); } @@ -690,35 +648,31 @@ public int getSerializedSize() { } if (cache_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getCache()); + .computeMessageSize(6, getCache()); } if (analytics_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getAnalytics()); + .computeMessageSize(7, getAnalytics()); } if (management_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, getManagement()); - } - if (restServer_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, getRestServer()); + .computeMessageSize(8, getManagement()); } if (tracing_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, getTracing()); + .computeMessageSize(9, getTracing()); } if (metrics_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, getMetrics()); + .computeMessageSize(10, getMetrics()); } for (int i = 0; i < filters_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(13, filters_.get(i)); + .computeMessageSize(11, filters_.get(i)); } if (soap_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, getSoap()); + .computeMessageSize(12, getSoap()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -775,11 +729,6 @@ public boolean equals(final java.lang.Object obj) { if (!getManagement() .equals(other.getManagement())) return false; } - if (hasRestServer() != other.hasRestServer()) return false; - if (hasRestServer()) { - if (!getRestServer() - .equals(other.getRestServer())) return false; - } if (hasTracing() != other.hasTracing()) return false; if (hasTracing()) { if (!getTracing() @@ -840,10 +789,6 @@ public int hashCode() { hash = (37 * hash) + MANAGEMENT_FIELD_NUMBER; hash = (53 * hash) + getManagement().hashCode(); } - if (hasRestServer()) { - hash = (37 * hash) + RESTSERVER_FIELD_NUMBER; - hash = (53 * hash) + getRestServer().hashCode(); - } if (hasTracing()) { hash = (37 * hash) + TRACING_FIELD_NUMBER; hash = (53 * hash) + getTracing().hashCode(); @@ -1046,12 +991,6 @@ public Builder clear() { management_ = null; managementBuilder_ = null; } - if (restServerBuilder_ == null) { - restServer_ = null; - } else { - restServer_ = null; - restServerBuilder_ = null; - } if (tracingBuilder_ == null) { tracing_ = null; } else { @@ -1143,11 +1082,6 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Config buildPartial() { } else { result.management_ = managementBuilder_.build(); } - if (restServerBuilder_ == null) { - result.restServer_ = restServer_; - } else { - result.restServer_ = restServerBuilder_.build(); - } if (tracingBuilder_ == null) { result.tracing_ = tracing_; } else { @@ -1244,9 +1178,6 @@ public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.Config if (other.hasManagement()) { mergeManagement(other.getManagement()); } - if (other.hasRestServer()) { - mergeRestServer(other.getRestServer()); - } if (other.hasTracing()) { mergeTracing(other.getTracing()); } @@ -1911,14 +1842,14 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder get private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Cache, org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder> cacheBuilder_; /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; * @return Whether the cache field is set. */ public boolean hasCache() { return cacheBuilder_ != null || cache_ != null; } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; * @return The cache. */ public org.wso2.apk.enforcer.discovery.config.enforcer.Cache getCache() { @@ -1929,7 +1860,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Cache getCache() { } } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ public Builder setCache(org.wso2.apk.enforcer.discovery.config.enforcer.Cache value) { if (cacheBuilder_ == null) { @@ -1945,7 +1876,7 @@ public Builder setCache(org.wso2.apk.enforcer.discovery.config.enforcer.Cache va return this; } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ public Builder setCache( org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder builderForValue) { @@ -1959,7 +1890,7 @@ public Builder setCache( return this; } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ public Builder mergeCache(org.wso2.apk.enforcer.discovery.config.enforcer.Cache value) { if (cacheBuilder_ == null) { @@ -1977,7 +1908,7 @@ public Builder mergeCache(org.wso2.apk.enforcer.discovery.config.enforcer.Cache return this; } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ public Builder clearCache() { if (cacheBuilder_ == null) { @@ -1991,7 +1922,7 @@ public Builder clearCache() { return this; } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder getCacheBuilder() { @@ -1999,7 +1930,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder getCacheBui return getCacheFieldBuilder().getBuilder(); } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ public org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder getCacheOrBuilder() { if (cacheBuilder_ != null) { @@ -2010,7 +1941,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder getCacheOr } } /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Cache, org.wso2.apk.enforcer.discovery.config.enforcer.Cache.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder> @@ -2030,14 +1961,14 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder getCacheOr private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Analytics, org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder> analyticsBuilder_; /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; * @return Whether the analytics field is set. */ public boolean hasAnalytics() { return analyticsBuilder_ != null || analytics_ != null; } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; * @return The analytics. */ public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics getAnalytics() { @@ -2048,7 +1979,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics getAnalytics() } } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ public Builder setAnalytics(org.wso2.apk.enforcer.discovery.config.enforcer.Analytics value) { if (analyticsBuilder_ == null) { @@ -2064,7 +1995,7 @@ public Builder setAnalytics(org.wso2.apk.enforcer.discovery.config.enforcer.Anal return this; } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ public Builder setAnalytics( org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder builderForValue) { @@ -2078,7 +2009,7 @@ public Builder setAnalytics( return this; } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ public Builder mergeAnalytics(org.wso2.apk.enforcer.discovery.config.enforcer.Analytics value) { if (analyticsBuilder_ == null) { @@ -2096,7 +2027,7 @@ public Builder mergeAnalytics(org.wso2.apk.enforcer.discovery.config.enforcer.An return this; } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ public Builder clearAnalytics() { if (analyticsBuilder_ == null) { @@ -2110,7 +2041,7 @@ public Builder clearAnalytics() { return this; } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder getAnalyticsBuilder() { @@ -2118,7 +2049,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder getAnal return getAnalyticsFieldBuilder().getBuilder(); } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder getAnalyticsOrBuilder() { if (analyticsBuilder_ != null) { @@ -2129,7 +2060,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder getAna } } /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Analytics, org.wso2.apk.enforcer.discovery.config.enforcer.Analytics.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder> @@ -2149,14 +2080,14 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder getAna private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Management, org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder> managementBuilder_; /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; * @return Whether the management field is set. */ public boolean hasManagement() { return managementBuilder_ != null || management_ != null; } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; * @return The management. */ public org.wso2.apk.enforcer.discovery.config.enforcer.Management getManagement() { @@ -2167,7 +2098,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Management getManagement( } } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ public Builder setManagement(org.wso2.apk.enforcer.discovery.config.enforcer.Management value) { if (managementBuilder_ == null) { @@ -2183,7 +2114,7 @@ public Builder setManagement(org.wso2.apk.enforcer.discovery.config.enforcer.Man return this; } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ public Builder setManagement( org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder builderForValue) { @@ -2197,7 +2128,7 @@ public Builder setManagement( return this; } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ public Builder mergeManagement(org.wso2.apk.enforcer.discovery.config.enforcer.Management value) { if (managementBuilder_ == null) { @@ -2215,7 +2146,7 @@ public Builder mergeManagement(org.wso2.apk.enforcer.discovery.config.enforcer.M return this; } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ public Builder clearManagement() { if (managementBuilder_ == null) { @@ -2229,7 +2160,7 @@ public Builder clearManagement() { return this; } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder getManagementBuilder() { @@ -2237,7 +2168,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder getMan return getManagementFieldBuilder().getBuilder(); } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ public org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder getManagementOrBuilder() { if (managementBuilder_ != null) { @@ -2248,7 +2179,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder getMa } } /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Management, org.wso2.apk.enforcer.discovery.config.enforcer.Management.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder> @@ -2264,137 +2195,18 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder getMa return managementBuilder_; } - private org.wso2.apk.enforcer.discovery.config.enforcer.RestServer restServer_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer, org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.RestServerOrBuilder> restServerBuilder_; - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - * @return Whether the restServer field is set. - */ - public boolean hasRestServer() { - return restServerBuilder_ != null || restServer_ != null; - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - * @return The restServer. - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServer getRestServer() { - if (restServerBuilder_ == null) { - return restServer_ == null ? org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.getDefaultInstance() : restServer_; - } else { - return restServerBuilder_.getMessage(); - } - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - public Builder setRestServer(org.wso2.apk.enforcer.discovery.config.enforcer.RestServer value) { - if (restServerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - restServer_ = value; - onChanged(); - } else { - restServerBuilder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - public Builder setRestServer( - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.Builder builderForValue) { - if (restServerBuilder_ == null) { - restServer_ = builderForValue.build(); - onChanged(); - } else { - restServerBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - public Builder mergeRestServer(org.wso2.apk.enforcer.discovery.config.enforcer.RestServer value) { - if (restServerBuilder_ == null) { - if (restServer_ != null) { - restServer_ = - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.newBuilder(restServer_).mergeFrom(value).buildPartial(); - } else { - restServer_ = value; - } - onChanged(); - } else { - restServerBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - public Builder clearRestServer() { - if (restServerBuilder_ == null) { - restServer_ = null; - onChanged(); - } else { - restServer_ = null; - restServerBuilder_ = null; - } - - return this; - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.Builder getRestServerBuilder() { - - onChanged(); - return getRestServerFieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServerOrBuilder getRestServerOrBuilder() { - if (restServerBuilder_ != null) { - return restServerBuilder_.getMessageOrBuilder(); - } else { - return restServer_ == null ? - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.getDefaultInstance() : restServer_; - } - } - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer, org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.RestServerOrBuilder> - getRestServerFieldBuilder() { - if (restServerBuilder_ == null) { - restServerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer, org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.RestServerOrBuilder>( - getRestServer(), - getParentForChildren(), - isClean()); - restServer_ = null; - } - return restServerBuilder_; - } - private org.wso2.apk.enforcer.discovery.config.enforcer.Tracing tracing_; private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Tracing, org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder> tracingBuilder_; /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; * @return Whether the tracing field is set. */ public boolean hasTracing() { return tracingBuilder_ != null || tracing_ != null; } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; * @return The tracing. */ public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing getTracing() { @@ -2405,7 +2217,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing getTracing() { } } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ public Builder setTracing(org.wso2.apk.enforcer.discovery.config.enforcer.Tracing value) { if (tracingBuilder_ == null) { @@ -2421,7 +2233,7 @@ public Builder setTracing(org.wso2.apk.enforcer.discovery.config.enforcer.Tracin return this; } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ public Builder setTracing( org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder builderForValue) { @@ -2435,7 +2247,7 @@ public Builder setTracing( return this; } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ public Builder mergeTracing(org.wso2.apk.enforcer.discovery.config.enforcer.Tracing value) { if (tracingBuilder_ == null) { @@ -2453,7 +2265,7 @@ public Builder mergeTracing(org.wso2.apk.enforcer.discovery.config.enforcer.Trac return this; } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ public Builder clearTracing() { if (tracingBuilder_ == null) { @@ -2467,7 +2279,7 @@ public Builder clearTracing() { return this; } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder getTracingBuilder() { @@ -2475,7 +2287,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder getTracin return getTracingFieldBuilder().getBuilder(); } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ public org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder getTracingOrBuilder() { if (tracingBuilder_ != null) { @@ -2486,7 +2298,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder getTraci } } /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Tracing, org.wso2.apk.enforcer.discovery.config.enforcer.Tracing.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder> @@ -2506,14 +2318,14 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder getTraci private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Metrics, org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder> metricsBuilder_; /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; * @return Whether the metrics field is set. */ public boolean hasMetrics() { return metricsBuilder_ != null || metrics_ != null; } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; * @return The metrics. */ public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics getMetrics() { @@ -2524,7 +2336,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics getMetrics() { } } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ public Builder setMetrics(org.wso2.apk.enforcer.discovery.config.enforcer.Metrics value) { if (metricsBuilder_ == null) { @@ -2540,7 +2352,7 @@ public Builder setMetrics(org.wso2.apk.enforcer.discovery.config.enforcer.Metric return this; } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ public Builder setMetrics( org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder builderForValue) { @@ -2554,7 +2366,7 @@ public Builder setMetrics( return this; } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ public Builder mergeMetrics(org.wso2.apk.enforcer.discovery.config.enforcer.Metrics value) { if (metricsBuilder_ == null) { @@ -2572,7 +2384,7 @@ public Builder mergeMetrics(org.wso2.apk.enforcer.discovery.config.enforcer.Metr return this; } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ public Builder clearMetrics() { if (metricsBuilder_ == null) { @@ -2586,7 +2398,7 @@ public Builder clearMetrics() { return this; } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder getMetricsBuilder() { @@ -2594,7 +2406,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder getMetric return getMetricsFieldBuilder().getBuilder(); } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ public org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder getMetricsOrBuilder() { if (metricsBuilder_ != null) { @@ -2605,7 +2417,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder getMetri } } /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Metrics, org.wso2.apk.enforcer.discovery.config.enforcer.Metrics.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder> @@ -2634,7 +2446,7 @@ private void ensureFiltersIsMutable() { org.wso2.apk.enforcer.discovery.config.enforcer.Filter, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder> filtersBuilder_; /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public java.util.List getFiltersList() { if (filtersBuilder_ == null) { @@ -2644,7 +2456,7 @@ public java.util.List ge } } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public int getFiltersCount() { if (filtersBuilder_ == null) { @@ -2654,7 +2466,7 @@ public int getFiltersCount() { } } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Filter getFilters(int index) { if (filtersBuilder_ == null) { @@ -2664,7 +2476,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Filter getFilters(int ind } } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder setFilters( int index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter value) { @@ -2681,7 +2493,7 @@ public Builder setFilters( return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder setFilters( int index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder builderForValue) { @@ -2695,7 +2507,7 @@ public Builder setFilters( return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder addFilters(org.wso2.apk.enforcer.discovery.config.enforcer.Filter value) { if (filtersBuilder_ == null) { @@ -2711,7 +2523,7 @@ public Builder addFilters(org.wso2.apk.enforcer.discovery.config.enforcer.Filter return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder addFilters( int index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter value) { @@ -2728,7 +2540,7 @@ public Builder addFilters( return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder addFilters( org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder builderForValue) { @@ -2742,7 +2554,7 @@ public Builder addFilters( return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder addFilters( int index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder builderForValue) { @@ -2756,7 +2568,7 @@ public Builder addFilters( return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder addAllFilters( java.lang.Iterable values) { @@ -2771,7 +2583,7 @@ public Builder addAllFilters( return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder clearFilters() { if (filtersBuilder_ == null) { @@ -2784,7 +2596,7 @@ public Builder clearFilters() { return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public Builder removeFilters(int index) { if (filtersBuilder_ == null) { @@ -2797,14 +2609,14 @@ public Builder removeFilters(int index) { return this; } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder getFiltersBuilder( int index) { return getFiltersFieldBuilder().getBuilder(index); } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder getFiltersOrBuilder( int index) { @@ -2814,7 +2626,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder getFilter } } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public java.util.List getFiltersOrBuilderList() { @@ -2825,14 +2637,14 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder getFilter } } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder addFiltersBuilder() { return getFiltersFieldBuilder().addBuilder( org.wso2.apk.enforcer.discovery.config.enforcer.Filter.getDefaultInstance()); } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder addFiltersBuilder( int index) { @@ -2840,7 +2652,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder addFilters index, org.wso2.apk.enforcer.discovery.config.enforcer.Filter.getDefaultInstance()); } /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ public java.util.List getFiltersBuilderList() { @@ -2865,14 +2677,14 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Filter.Builder addFilters private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Soap, org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder> soapBuilder_; /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; * @return Whether the soap field is set. */ public boolean hasSoap() { return soapBuilder_ != null || soap_ != null; } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; * @return The soap. */ public org.wso2.apk.enforcer.discovery.config.enforcer.Soap getSoap() { @@ -2883,7 +2695,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Soap getSoap() { } } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ public Builder setSoap(org.wso2.apk.enforcer.discovery.config.enforcer.Soap value) { if (soapBuilder_ == null) { @@ -2899,7 +2711,7 @@ public Builder setSoap(org.wso2.apk.enforcer.discovery.config.enforcer.Soap valu return this; } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ public Builder setSoap( org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder builderForValue) { @@ -2913,7 +2725,7 @@ public Builder setSoap( return this; } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ public Builder mergeSoap(org.wso2.apk.enforcer.discovery.config.enforcer.Soap value) { if (soapBuilder_ == null) { @@ -2931,7 +2743,7 @@ public Builder mergeSoap(org.wso2.apk.enforcer.discovery.config.enforcer.Soap va return this; } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ public Builder clearSoap() { if (soapBuilder_ == null) { @@ -2945,7 +2757,7 @@ public Builder clearSoap() { return this; } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ public org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder getSoapBuilder() { @@ -2953,7 +2765,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder getSoapBuild return getSoapFieldBuilder().getBuilder(); } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ public org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder getSoapOrBuilder() { if (soapBuilder_ != null) { @@ -2964,7 +2776,7 @@ public org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder getSoapOrBu } } /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ private com.google.protobuf.SingleFieldBuilderV3< org.wso2.apk.enforcer.discovery.config.enforcer.Soap, org.wso2.apk.enforcer.discovery.config.enforcer.Soap.Builder, org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder> diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigOrBuilder.java index 63fa44185..b1b891c32 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigOrBuilder.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigOrBuilder.java @@ -83,131 +83,116 @@ public interface ConfigOrBuilder extends org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorOrBuilder getJwtGeneratorOrBuilder(); /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; * @return Whether the cache field is set. */ boolean hasCache(); /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; * @return The cache. */ org.wso2.apk.enforcer.discovery.config.enforcer.Cache getCache(); /** - * .wso2.discovery.config.enforcer.Cache cache = 7; + * .wso2.discovery.config.enforcer.Cache cache = 6; */ org.wso2.apk.enforcer.discovery.config.enforcer.CacheOrBuilder getCacheOrBuilder(); /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; * @return Whether the analytics field is set. */ boolean hasAnalytics(); /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; * @return The analytics. */ org.wso2.apk.enforcer.discovery.config.enforcer.Analytics getAnalytics(); /** - * .wso2.discovery.config.enforcer.Analytics analytics = 8; + * .wso2.discovery.config.enforcer.Analytics analytics = 7; */ org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsOrBuilder getAnalyticsOrBuilder(); /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; * @return Whether the management field is set. */ boolean hasManagement(); /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; * @return The management. */ org.wso2.apk.enforcer.discovery.config.enforcer.Management getManagement(); /** - * .wso2.discovery.config.enforcer.Management management = 9; + * .wso2.discovery.config.enforcer.Management management = 8; */ org.wso2.apk.enforcer.discovery.config.enforcer.ManagementOrBuilder getManagementOrBuilder(); /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - * @return Whether the restServer field is set. - */ - boolean hasRestServer(); - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - * @return The restServer. - */ - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer getRestServer(); - /** - * .wso2.discovery.config.enforcer.RestServer restServer = 10; - */ - org.wso2.apk.enforcer.discovery.config.enforcer.RestServerOrBuilder getRestServerOrBuilder(); - - /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; * @return Whether the tracing field is set. */ boolean hasTracing(); /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; * @return The tracing. */ org.wso2.apk.enforcer.discovery.config.enforcer.Tracing getTracing(); /** - * .wso2.discovery.config.enforcer.Tracing tracing = 11; + * .wso2.discovery.config.enforcer.Tracing tracing = 9; */ org.wso2.apk.enforcer.discovery.config.enforcer.TracingOrBuilder getTracingOrBuilder(); /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; * @return Whether the metrics field is set. */ boolean hasMetrics(); /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; * @return The metrics. */ org.wso2.apk.enforcer.discovery.config.enforcer.Metrics getMetrics(); /** - * .wso2.discovery.config.enforcer.Metrics metrics = 12; + * .wso2.discovery.config.enforcer.Metrics metrics = 10; */ org.wso2.apk.enforcer.discovery.config.enforcer.MetricsOrBuilder getMetricsOrBuilder(); /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ java.util.List getFiltersList(); /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ org.wso2.apk.enforcer.discovery.config.enforcer.Filter getFilters(int index); /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ int getFiltersCount(); /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ java.util.List getFiltersOrBuilderList(); /** - * repeated .wso2.discovery.config.enforcer.Filter filters = 13; + * repeated .wso2.discovery.config.enforcer.Filter filters = 11; */ org.wso2.apk.enforcer.discovery.config.enforcer.FilterOrBuilder getFiltersOrBuilder( int index); /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; * @return Whether the soap field is set. */ boolean hasSoap(); /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; * @return The soap. */ org.wso2.apk.enforcer.discovery.config.enforcer.Soap getSoap(); /** - * .wso2.discovery.config.enforcer.Soap soap = 14; + * .wso2.discovery.config.enforcer.Soap soap = 12; */ org.wso2.apk.enforcer.discovery.config.enforcer.SoapOrBuilder getSoapOrBuilder(); } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigProto.java index 41b56b55c..6d5e644d4 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigProto.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/ConfigProto.java @@ -38,36 +38,33 @@ public static void registerAllExtensions( "onfig/enforcer/analytics.proto\032-wso2/dis" + "covery/config/enforcer/security.proto\032/w" + "so2/discovery/config/enforcer/management" + - ".proto\0320wso2/discovery/config/enforcer/r" + - "est_server.proto\032+wso2/discovery/config/" + - "enforcer/filter.proto\032,wso2/discovery/co" + - "nfig/enforcer/tracing.proto\032,wso2/discov" + - "ery/config/enforcer/metrics.proto\032)wso2/" + - "discovery/config/enforcer/soap.proto\"\227\006\n" + - "\006Config\022:\n\010security\030\001 \001(\0132(.wso2.discove" + - "ry.config.enforcer.Security\022;\n\010keystore\030" + - "\002 \001(\0132).wso2.discovery.config.enforcer.C" + - "ertStore\022=\n\ntruststore\030\003 \001(\0132).wso2.disc" + - "overy.config.enforcer.CertStore\022<\n\013authS" + - "ervice\030\004 \001(\0132\'.wso2.discovery.config.enf" + - "orcer.Service\022B\n\014jwtGenerator\030\005 \001(\0132,.ws" + - "o2.discovery.config.enforcer.JWTGenerato" + - "r\0224\n\005cache\030\007 \001(\0132%.wso2.discovery.config" + - ".enforcer.Cache\022<\n\tanalytics\030\010 \001(\0132).wso" + - "2.discovery.config.enforcer.Analytics\022>\n" + - "\nmanagement\030\t \001(\0132*.wso2.discovery.confi" + - "g.enforcer.Management\022>\n\nrestServer\030\n \001(" + - "\0132*.wso2.discovery.config.enforcer.RestS" + - "erver\0228\n\007tracing\030\013 \001(\0132\'.wso2.discovery." + - "config.enforcer.Tracing\0228\n\007metrics\030\014 \001(\013" + - "2\'.wso2.discovery.config.enforcer.Metric" + - "s\0227\n\007filters\030\r \003(\0132&.wso2.discovery.conf" + - "ig.enforcer.Filter\0222\n\004soap\030\016 \001(\0132$.wso2." + - "discovery.config.enforcer.SoapB\220\001\n/org.w" + - "so2.apk.enforcer.discovery.config.enforc" + - "erB\013ConfigProtoP\001ZNgithub.com/envoyproxy" + - "/go-control-plane/wso2/discovery/config/" + - "enforcer;enforcerb\006proto3" + ".proto\032+wso2/discovery/config/enforcer/f" + + "ilter.proto\032,wso2/discovery/config/enfor" + + "cer/tracing.proto\032,wso2/discovery/config" + + "/enforcer/metrics.proto\032)wso2/discovery/" + + "config/enforcer/soap.proto\"\327\005\n\006Config\022:\n" + + "\010security\030\001 \001(\0132(.wso2.discovery.config." + + "enforcer.Security\022;\n\010keystore\030\002 \001(\0132).ws" + + "o2.discovery.config.enforcer.CertStore\022=" + + "\n\ntruststore\030\003 \001(\0132).wso2.discovery.conf" + + "ig.enforcer.CertStore\022<\n\013authService\030\004 \001" + + "(\0132\'.wso2.discovery.config.enforcer.Serv" + + "ice\022B\n\014jwtGenerator\030\005 \001(\0132,.wso2.discove" + + "ry.config.enforcer.JWTGenerator\0224\n\005cache" + + "\030\006 \001(\0132%.wso2.discovery.config.enforcer." + + "Cache\022<\n\tanalytics\030\007 \001(\0132).wso2.discover" + + "y.config.enforcer.Analytics\022>\n\nmanagemen" + + "t\030\010 \001(\0132*.wso2.discovery.config.enforcer" + + ".Management\0228\n\007tracing\030\t \001(\0132\'.wso2.disc" + + "overy.config.enforcer.Tracing\0228\n\007metrics" + + "\030\n \001(\0132\'.wso2.discovery.config.enforcer." + + "Metrics\0227\n\007filters\030\013 \003(\0132&.wso2.discover" + + "y.config.enforcer.Filter\0222\n\004soap\030\014 \001(\0132$" + + ".wso2.discovery.config.enforcer.SoapB\220\001\n" + + "/org.wso2.apk.enforcer.discovery.config." + + "enforcerB\013ConfigProtoP\001ZNgithub.com/envo" + + "yproxy/go-control-plane/wso2/discovery/c" + + "onfig/enforcer;enforcerb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -79,7 +76,6 @@ public static void registerAllExtensions( org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsProto.getDescriptor(), org.wso2.apk.enforcer.discovery.config.enforcer.SecurityProto.getDescriptor(), org.wso2.apk.enforcer.discovery.config.enforcer.ManagementProto.getDescriptor(), - org.wso2.apk.enforcer.discovery.config.enforcer.RestServerProto.getDescriptor(), org.wso2.apk.enforcer.discovery.config.enforcer.FilterProto.getDescriptor(), org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.getDescriptor(), org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.getDescriptor(), @@ -90,7 +86,7 @@ public static void registerAllExtensions( internal_static_wso2_discovery_config_enforcer_Config_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_wso2_discovery_config_enforcer_Config_descriptor, - new java.lang.String[] { "Security", "Keystore", "Truststore", "AuthService", "JwtGenerator", "Cache", "Analytics", "Management", "RestServer", "Tracing", "Metrics", "Filters", "Soap", }); + new java.lang.String[] { "Security", "Keystore", "Truststore", "AuthService", "JwtGenerator", "Cache", "Analytics", "Management", "Tracing", "Metrics", "Filters", "Soap", }); org.wso2.apk.enforcer.discovery.config.enforcer.CertStoreProto.getDescriptor(); org.wso2.apk.enforcer.discovery.config.enforcer.ServiceProto.getDescriptor(); org.wso2.apk.enforcer.discovery.config.enforcer.JWTGeneratorProto.getDescriptor(); @@ -98,7 +94,6 @@ public static void registerAllExtensions( org.wso2.apk.enforcer.discovery.config.enforcer.AnalyticsProto.getDescriptor(); org.wso2.apk.enforcer.discovery.config.enforcer.SecurityProto.getDescriptor(); org.wso2.apk.enforcer.discovery.config.enforcer.ManagementProto.getDescriptor(); - org.wso2.apk.enforcer.discovery.config.enforcer.RestServerProto.getDescriptor(); org.wso2.apk.enforcer.discovery.config.enforcer.FilterProto.getDescriptor(); org.wso2.apk.enforcer.discovery.config.enforcer.TracingProto.getDescriptor(); org.wso2.apk.enforcer.discovery.config.enforcer.MetricsProto.getDescriptor(); diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServer.java deleted file mode 100644 index bb58fcd20..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServer.java +++ /dev/null @@ -1,508 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/rest_server.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -/** - *
- * Model for enable/ disable enforcer admin rest api
- * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.RestServer} - */ -public final class RestServer extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.config.enforcer.RestServer) - RestServerOrBuilder { -private static final long serialVersionUID = 0L; - // Use RestServer.newBuilder() to construct. - private RestServer(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RestServer() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RestServer(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RestServer( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - enable_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.RestServerProto.internal_static_wso2_discovery_config_enforcer_RestServer_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.RestServerProto.internal_static_wso2_discovery_config_enforcer_RestServer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.class, org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.Builder.class); - } - - public static final int ENABLE_FIELD_NUMBER = 1; - private boolean enable_; - /** - *
-   * Enable outbound auth header
-   * 
- * - * bool enable = 1; - * @return The enable. - */ - @java.lang.Override - public boolean getEnable() { - return enable_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (enable_ != false) { - output.writeBool(1, enable_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enable_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.config.enforcer.RestServer)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer other = (org.wso2.apk.enforcer.discovery.config.enforcer.RestServer) obj; - - if (getEnable() - != other.getEnable()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnable()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.config.enforcer.RestServer prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Model for enable/ disable enforcer admin rest api
-   * 
- * - * Protobuf type {@code wso2.discovery.config.enforcer.RestServer} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.config.enforcer.RestServer) - org.wso2.apk.enforcer.discovery.config.enforcer.RestServerOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.config.enforcer.RestServerProto.internal_static_wso2_discovery_config_enforcer_RestServer_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.config.enforcer.RestServerProto.internal_static_wso2_discovery_config_enforcer_RestServer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.class, org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - enable_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.RestServerProto.internal_static_wso2_discovery_config_enforcer_RestServer_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServer getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServer build() { - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServer buildPartial() { - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer result = new org.wso2.apk.enforcer.discovery.config.enforcer.RestServer(this); - result.enable_ = enable_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.config.enforcer.RestServer) { - return mergeFrom((org.wso2.apk.enforcer.discovery.config.enforcer.RestServer)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.config.enforcer.RestServer other) { - if (other == org.wso2.apk.enforcer.discovery.config.enforcer.RestServer.getDefaultInstance()) return this; - if (other.getEnable() != false) { - setEnable(other.getEnable()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.config.enforcer.RestServer parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.config.enforcer.RestServer) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enable_ ; - /** - *
-     * Enable outbound auth header
-     * 
- * - * bool enable = 1; - * @return The enable. - */ - @java.lang.Override - public boolean getEnable() { - return enable_; - } - /** - *
-     * Enable outbound auth header
-     * 
- * - * bool enable = 1; - * @param value The enable to set. - * @return This builder for chaining. - */ - public Builder setEnable(boolean value) { - - enable_ = value; - onChanged(); - return this; - } - /** - *
-     * Enable outbound auth header
-     * 
- * - * bool enable = 1; - * @return This builder for chaining. - */ - public Builder clearEnable() { - - enable_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.config.enforcer.RestServer) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.config.enforcer.RestServer) - private static final org.wso2.apk.enforcer.discovery.config.enforcer.RestServer DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.config.enforcer.RestServer(); - } - - public static org.wso2.apk.enforcer.discovery.config.enforcer.RestServer getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RestServer parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RestServer(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.config.enforcer.RestServer getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServerOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServerOrBuilder.java deleted file mode 100644 index 9d0104b08..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServerOrBuilder.java +++ /dev/null @@ -1,19 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/rest_server.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public interface RestServerOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.config.enforcer.RestServer) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Enable outbound auth header
-   * 
- * - * bool enable = 1; - * @return The enable. - */ - boolean getEnable(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServerProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServerProto.java deleted file mode 100644 index dfe166ce4..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/config/enforcer/RestServerProto.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/config/enforcer/rest_server.proto - -package org.wso2.apk.enforcer.discovery.config.enforcer; - -public final class RestServerProto { - private RestServerProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_config_enforcer_RestServer_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_config_enforcer_RestServer_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n0wso2/discovery/config/enforcer/rest_se" + - "rver.proto\022\036wso2.discovery.config.enforc" + - "er\"\034\n\nRestServer\022\016\n\006enable\030\001 \001(\010B\224\001\n/org" + - ".wso2.apk.enforcer.discovery.config.enfo" + - "rcerB\017RestServerProtoP\001ZNgithub.com/envo" + - "yproxy/go-control-plane/wso2/discovery/c" + - "onfig/enforcer;enforcerb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_config_enforcer_RestServer_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_config_enforcer_RestServer_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_config_enforcer_RestServer_descriptor, - new java.lang.String[] { "Enable", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RestServer.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RestServer.java index 6d3203a14..88cbcfa32 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RestServer.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/server/RestServer.java @@ -30,7 +30,6 @@ import io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.admin.AdminServerInitializer; import org.wso2.apk.enforcer.config.ConfigHolder; import org.wso2.apk.enforcer.jwks.JWKSRequestHandler; import org.wso2.apk.enforcer.jwks.JWKSServerInitializer; @@ -38,7 +37,6 @@ import java.io.File; import java.nio.file.Paths; -import java.security.cert.CertificateException; import javax.net.ssl.SSLException; @@ -48,9 +46,8 @@ public class RestServer { private static final Logger logger = LogManager.getLogger(RestServer.class); - static final int ADMIN_PORT = 9001; - public void initServer() throws SSLException, CertificateException, InterruptedException { + public void initServer() throws SSLException, InterruptedException { logger.info("New Rest Server New"); // Configure SSL @@ -85,21 +82,6 @@ public void initServer() throws SSLException, CertificateException, InterruptedE logger.info("JWKS endpoint started Listening in port : " + 9092); jwksChannel.closeFuture().sync(); - - if (ConfigHolder.getInstance().getConfig().getRestServer().isEnable()) { - ServerBootstrap adminServer = new ServerBootstrap(); - // Configure the server - adminServer.option(ChannelOption.SO_BACKLOG, 1024); - adminServer.group(bossGroup, workerGroup) - .channel(NioServerSocketChannel.class) - .handler(new LoggingHandler(LogLevel.INFO)) - .childHandler(new AdminServerInitializer(sslCtx)); - - Channel adminChannel = adminServer.bind(ADMIN_PORT).sync().channel(); - logger.info("Admin endpoint started Listening in port : " + ADMIN_PORT); - adminChannel.closeFuture().sync(); - } - swaggerChannel.closeFuture().sync(); } finally {